chore: simplify filling values
Some checks failed
Release / call-build-workflow (push) Has been cancelled
Release / Publish Docker :release (push) Has been cancelled
Release / Github & APT (push) Has been cancelled
Release / Demo (push) Has been cancelled
Release / Hassio Addon (push) Has been cancelled

This commit is contained in:
andig 2023-10-13 13:35:31 +02:00
parent 85e2d70d18
commit 2ebd09ed95

View file

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