Skip to content

Commit

Permalink
Battery control: limit at 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Apr 16, 2024
1 parent 341101c commit 0700882
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion meter/battery.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (m *battery) LimitController(socG func() (float64, error), limitSocS func(f
if err != nil {
return err
}
return limitSocS(max(soc, m.MinSoc))
return limitSocS(min(100, max(soc, m.MinSoc)))

case api.BatteryCharge:
return limitSocS(m.MaxSoc)
Expand Down

0 comments on commit 0700882

Please sign in to comment.