Revert "Fix phase usage estimation from power"

This reverts commit 60760cad618cf653d159b56603a7bd9e52fcaeb5.
This commit is contained in:
andig 2022-01-02 13:39:54 +01:00
parent fb1d6f552f
commit 13dac30def

View file

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