From 00b2a327d6cc5a42ead956fb5f417cf4a0fe949c Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Wed, 10 Jan 2024 20:58:15 +0100 Subject: [PATCH] Fix broken plan view for disconnected soc vehicles (#11603) --- assets/js/components/Loadpoint.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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: {