Tesla: fix asleep detection

This commit is contained in:
andig 2025-01-24 18:17:05 +01:00
parent 609b55f320
commit 0a83391856

View file

@ -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