Site: support battery mode not available (usually charge mode)
This commit is contained in:
parent
4bbaf0de47
commit
01a5e2381c
1 changed files with 3 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue