Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Jan 3, 2025
1 parent 2d26874 commit 655cc1a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,11 @@ func (site *Site) updateBatteryMeters() {
mm[i].Controllable = lo.ToPtr(controllable)
}

site.batterySoc = lo.Reduce(mm, func(acc float64, m batteryMeasurement, _ int) float64 {
site.batterySoc = lo.Reduce(mm, func(acc float64, m measurement, _ int) float64 {
// weigh soc by capacity
weighedSoc := m.Soc
if m.Capacity > 0 {
weighedSoc *= m.Capacity
weighedSoc := *m.Soc
if *m.Capacity > 0 {
weighedSoc *= *m.Capacity
}
return acc + weighedSoc
}, 0)
Expand Down

0 comments on commit 655cc1a

Please sign in to comment.