diff --git a/assets/js/components/Loadpoint.vue b/assets/js/components/Loadpoint.vue index 2fe96f110..62a0fe62e 100644 --- a/assets/js/components/Loadpoint.vue +++ b/assets/js/components/Loadpoint.vue @@ -244,8 +244,19 @@ export default { socBasedCharging: function () { return (!this.vehicleFeatureOffline && this.vehiclePresent) || this.vehicleSoc > 0; }, + knownVehicle: function () { + return !!this.vehicleName; + }, + vehicleHasSoc: function () { + return this.knownVehicle && !this.vehicleFeatureOffline; + }, socBasedPlanning: function () { - return this.vehicleSoc > 0 && this.vehicleCapacity > 0; + // TODO: deduplicate business logic. see also: socBasedPlanning() in loadpoint.go + return ( + this.knownVehicle && + this.vehicleCapacity > 0 && + (this.vehicleHasSoc || this.vehicleSoc > 0) + ); }, }, watch: {