Tesla: fix asleep detection
This commit is contained in:
parent
609b55f320
commit
0a83391856
1 changed files with 1 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ func addInstance(subject string, identity *Identity) {
|
|||
func apiError(err error) error {
|
||||
if err != nil && (errors.Is(err, inet.ErrVehicleNotAwake) ||
|
||||
strings.HasSuffix(err.Error(), "408 Request Timeout") || strings.HasSuffix(err.Error(), "408 (Request Timeout)") ||
|
||||
strings.HasSuffix(err.Error(), "vehicle is offline or asleep")) {
|
||||
strings.Contains(err.Error(), "vehicle is offline or asleep")) {
|
||||
err = api.ErrAsleep
|
||||
}
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue