Optimizer: fix panic in prorate on continuousDemand returning nil (#24996)
This commit is contained in:
parent
1c00a7d746
commit
8be195b341
1 changed files with 3 additions and 1 deletions
|
|
@ -200,7 +200,9 @@ func (site *Site) optimizerUpdate(battery []measurement) error {
|
|||
|
||||
case api.ModeNow, api.ModeMinPV:
|
||||
// forced min/max charging
|
||||
bat.PDemand = prorate(continuousDemand(lp, minLen), firstSlotDuration)
|
||||
if demand := continuousDemand(lp, minLen); demand != nil {
|
||||
bat.PDemand = prorate(demand, firstSlotDuration)
|
||||
}
|
||||
|
||||
case api.ModePV:
|
||||
// add plan goal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue