Loadpoint: don't log expected errors (#26420)

This commit is contained in:
andig 2026-01-04 17:21:40 +01:00 • committed by GitHub
parent da7ec0ad45
commit 2b478a592f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 7 deletions

View file

@ -7,6 +7,7 @@ import (
"github.com/benbjohnson/clock"
"github.com/evcc-io/evcc/api"
"github.com/evcc-io/evcc/core/loadpoint"
"github.com/evcc-io/evcc/util"
)
@ -52,7 +53,7 @@ func (cr *ChargeRater) StartCharge(continued bool) {
if f, err := m.TotalEnergy(); err == nil {
cr.startEnergy = f
cr.log.DEBUG.Printf("charge start energy: %.3fkWh", f)
} else {
} else if !loadpoint.AcceptableError(err) {
cr.log.ERROR.Printf("charge total import: %v", err)
}
}
@ -77,7 +78,7 @@ func (cr *ChargeRater) StopCharge() {
if f, err := m.TotalEnergy(); err == nil {
cr.chargedEnergy += f - cr.startEnergy
cr.log.DEBUG.Printf("charge final energy: %.3fkWh", cr.chargedEnergy)
} else {
} else if !loadpoint.AcceptableError(err) {
cr.log.ERROR.Printf("charge total import: %v", err)
}
}
@ -97,7 +98,7 @@ func (cr *ChargeRater) ResetCharge() {
cr.log.DEBUG.Printf("charge final energy: %.3fkWh", cr.chargedEnergy)
cr.startEnergy = f
} else {
} else if !loadpoint.AcceptableError(err) {
cr.log.ERROR.Printf("charge total import: %v", err)
}
}