From ff5c6feb5ac0536d8b9d4bf0076c35f34f6e1945 Mon Sep 17 00:00:00 2001 From: andig Date: Thu, 18 Aug 2022 15:41:07 +0200 Subject: [PATCH] Battery: round instead of truncate --- core/site.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/site.go b/core/site.go index a7c132cbc..a4f2bc69e 100644 --- a/core/site.go +++ b/core/site.go @@ -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()