From 2ebd09ed9547ccc84c4d6397181e0cbf949a77b0 Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 13 Oct 2023 13:35:31 +0200 Subject: [PATCH] chore: simplify filling values --- charger/eebus.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/charger/eebus.go b/charger/eebus.go index 43e086c50..255a7c0b5 100644 --- a/charger/eebus.go +++ b/charger/eebus.go @@ -453,11 +453,9 @@ func (c *EEBus) currents() (float64, float64, float64, error) { return 0, 0, 0, err } - count := len(currents) - if count < 3 { - for fill := 0; fill < 3-count; fill++ { - currents = append(currents, 0) - } + // fill phases + for i := len(currents); i < 3; i++ { + currents = append(currents, 0) } return currents[0], currents[1], currents[2], nil