Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Feb 5, 2025
2 parents 97f6bb9 + 49dcf95 commit 522d926
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 @@ -549,7 +549,7 @@ func (site *Site) updateBatteryMeters() {
mm[i].Controllable = lo.ToPtr(controllable)
}

site.batterySoc = lo.SumBy(mm, func(m measurement) float64 {
batterySocAcc := lo.SumBy(mm, func(m measurement) float64 {
// weigh soc by capacity
if *m.Capacity > 0 {
return *m.Soc * *m.Capacity
Expand All @@ -564,7 +564,7 @@ func (site *Site) updateBatteryMeters() {
if totalCapacity == 0 {
totalCapacity = float64(len(site.batteryMeters))
}
site.batterySoc /= totalCapacity
site.batterySoc = batterySocAcc / totalCapacity

site.batteryPower = lo.SumBy(mm, func(m measurement) float64 {
return m.Power
Expand Down

0 comments on commit 522d926

Please sign in to comment.