From 515d864216b63d2c6a68091990f8cced6b1026f9 Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 8 Sep 2024 14:42:22 +0200 Subject: [PATCH] chore: minor --- charger/eebus.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/charger/eebus.go b/charger/eebus.go index 552b6839f2..2035055429 100644 --- a/charger/eebus.go +++ b/charger/eebus.go @@ -580,8 +580,7 @@ func (c *EEBus) currents() (float64, float64, float64, error) { // if there is no measurement data available within 15 seconds after the last limit change, return an error // only consider it an error, if there is no measurement data since 15 seconds after the last limit change // a measurement only being available before the last limit change is not an error, because that can happen often - d := ts.Sub(c.limitUpdated) - if !c.limitUpdated.IsZero() && (d > 15*time.Second) { + if d := ts.Sub(c.limitUpdated); d > 15*time.Second && !c.limitUpdated.IsZero() { return 0, 0, 0, api.ErrNotAvailable }