From 4655593b33eee69e1b1fe828fb0b523c120de72c Mon Sep 17 00:00:00 2001 From: andig Date: Mon, 3 Jul 2023 10:26:52 +0200 Subject: [PATCH] Fix charging not stopped when energy limit reached (#8768) --- core/loadpoint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/loadpoint.go b/core/loadpoint.go index 319b10758..1016ebb64 100644 --- a/core/loadpoint.go +++ b/core/loadpoint.go @@ -746,7 +746,7 @@ func (lp *Loadpoint) setStatus(status api.ChargeStatus) { // remainingChargeEnergy returns missing energy amount in kWh if vehicle has a valid energy target func (lp *Loadpoint) remainingChargeEnergy() (float64, bool) { return math.Max(0, lp.targetEnergy-lp.getChargedEnergy()/1e3), - lp.vehicleHasSoc() && lp.targetEnergy > 0 + !lp.vehicleHasSoc() && lp.targetEnergy > 0 } func (lp *Loadpoint) vehicleHasSoc() bool {