Skip to content

Commit

Permalink
Site: support battery mode not available (usually charge mode)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Sep 14, 2024
1 parent 4bbaf0d commit 01a5e23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/site_battery.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package core

import (
"errors"

"github.com/evcc-io/evcc/api"
"github.com/evcc-io/evcc/core/keys"
"github.com/evcc-io/evcc/core/loadpoint"
Expand Down Expand Up @@ -60,7 +62,7 @@ func (site *Site) requiredBatteryMode(batteryGridChargeActive bool, rate api.Rat
func (site *Site) applyBatteryMode(mode api.BatteryMode) error {
for _, meter := range site.batteryMeters {
if batCtrl, ok := meter.(api.BatteryController); ok {
if err := batCtrl.SetBatteryMode(mode); err != nil {
if err := batCtrl.SetBatteryMode(mode); err != nil && !errors.Is(err, api.ErrNotAvailable) {
return err
}
}
Expand Down

0 comments on commit 01a5e23

Please sign in to comment.