From 13dac30def47a7666969fe090c2f4cf7a1a08133 Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 2 Jan 2022 13:39:54 +0100 Subject: [PATCH] Revert "Fix phase usage estimation from power" This reverts commit 60760cad618cf653d159b56603a7bd9e52fcaeb5. --- core/loadpoint.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/loadpoint.go b/core/loadpoint.go index 419681b70..24bac0b5a 100644 --- a/core/loadpoint.go +++ b/core/loadpoint.go @@ -1199,7 +1199,7 @@ func (lp *LoadPoint) updateChargeCurrents() { // guess active phases from power consumption // assumes that chargePower has been updated before if lp.charging() && lp.chargeCurrent > 0 { - phases := int(math.Ceil(lp.chargePower / Voltage / lp.chargeCurrent)) + phases := int(math.Round(lp.chargePower / Voltage / lp.chargeCurrent)) if phases >= 1 && phases <= 3 { lp.activePhases = phases lp.log.DEBUG.Printf("detected phases: %dp (%.1fA @ %.0fW)", lp.activePhases, lp.chargeCurrent, lp.chargePower)