Fix broken plan view for disconnected soc vehicles (#11603)

This commit is contained in:
Michael Geers 2024-01-10 20:58:15 +01:00 • committed by GitHub
parent c9228cf3a4
commit 00b2a327d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: {