Skip to content

Commit

Permalink
chore: publish battery soc and capacity as float
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored and thierolm committed Oct 21, 2023
1 parent 73f53fe commit 1fd44fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ func (site *Site) updateMeters() error {
}
}

site.publish("batteryCapacity", math.Round(totalCapacity))
site.publish("batteryCapacity", totalCapacity)

// convert weighed socs to total soc
if totalCapacity == 0 {
Expand All @@ -524,7 +524,7 @@ func (site *Site) updateMeters() error {
site.batterySoc /= totalCapacity

site.log.DEBUG.Printf("battery soc: %.0f%%", math.Round(site.batterySoc))
site.publish("batterySoc", math.Round(site.batterySoc))
site.publish("batterySoc", site.batterySoc)

site.log.DEBUG.Printf("battery power: %.0fW", site.batteryPower)
site.publish("batteryPower", site.batteryPower)
Expand Down

0 comments on commit 1fd44fc

Please sign in to comment.