Optimizer: send zero solar forecast when current forecast is empty (#30637)
This commit is contained in:
parent
bfb55dc2c4
commit
1bb1ad2011
1 changed files with 2 additions and 2 deletions
|
|
@ -153,7 +153,7 @@ func (site *Site) optimizerUpdate(battery []types.Measurement) error {
|
|||
|
||||
// allow empty solar forecast
|
||||
ft := lo.RepeatBy(minLen, func(i int) float32 { return float32(0) })
|
||||
if solarTariff != nil {
|
||||
if solarTariff != nil && len(solar) > 0 {
|
||||
solarEnergy, err := solarRatesToEnergy(solar)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -771,7 +771,7 @@ func apiError(resp *optimizer.PostOptimizeChargeScheduleResponse) error {
|
|||
}
|
||||
|
||||
if errObj == nil {
|
||||
return fmt.Errorf("invalid status: %d", resp.StatusCode())
|
||||
return fmt.Errorf("invalid status: %d: %s", resp.StatusCode(), resp.Body)
|
||||
}
|
||||
|
||||
if len(errObj.Details) > 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue