Ignore must retry errors
This commit is contained in:
parent
2c4a3f6c20
commit
9f51152c61
1 changed files with 4 additions and 0 deletions
|
|
@ -93,6 +93,10 @@ func (s *Estimator) RemainingChargeEnergy(targetSoC int) float64 {
|
|||
func (s *Estimator) SoC(chargedEnergy float64) (float64, error) {
|
||||
f, err := s.vehicle.SoC()
|
||||
if err != nil {
|
||||
if errors.Is(err, api.ErrMustRetry) {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
s.log.WARN.Printf("updating soc failed: %v", err)
|
||||
|
||||
// try to recover from temporary vehicle-api errors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue