Reduce amount of logging (#1408)
This commit is contained in:
parent
a8137ec190
commit
77552ad722
2 changed files with 7 additions and 8 deletions
|
|
@ -1184,9 +1184,8 @@ func (lp *LoadPoint) publishSoCAndRange() {
|
|||
} else {
|
||||
if errors.Is(err, api.ErrMustRetry) {
|
||||
lp.socUpdated = time.Time{}
|
||||
lp.log.DEBUG.Printf("vehicle: waiting for update")
|
||||
} else {
|
||||
lp.log.ERROR.Printf("vehicle: %v", err)
|
||||
lp.log.ERROR.Printf("vehicle soc: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,14 +111,14 @@ func (s *Estimator) SoC(chargedEnergy float64) (float64, error) {
|
|||
return 0, err
|
||||
}
|
||||
|
||||
s.log.WARN.Printf("updating soc failed: %v", err)
|
||||
|
||||
// try to recover from temporary vehicle-api errors
|
||||
if s.prevSoC == 0 { // never received a soc value
|
||||
return s.socCharge, err
|
||||
// never received a soc value
|
||||
if s.prevSoC == 0 {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
f = s.prevSoC // recover last received soc
|
||||
// recover from temporary api errors
|
||||
f = s.prevSoC
|
||||
s.log.WARN.Printf("vehicle soc: %v (ignored by estimator)", err)
|
||||
}
|
||||
|
||||
fetchedSoC = &f
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue