Battery: round instead of truncate

This commit is contained in:
andig 2022-08-18 15:41:07 +02:00
parent 67bf75de8e
commit ff5c6feb5a

View file

@ -396,7 +396,7 @@ func (site *Site) sitePower(totalChargePower float64) (float64, error) {
socs += soc / float64(len(site.batteryMeters))
}
}
site.publish("batterySoC", math.Trunc(socs))
site.publish("batterySoC", math.Round(socs))
site.Lock()
defer site.Unlock()