Tesla: fix vehicle asleep detection
This commit is contained in:
parent
a74098382a
commit
db6ed8e1b0
3 changed files with 5 additions and 4 deletions
2
go.mod
2
go.mod
|
|
@ -28,7 +28,7 @@ require (
|
|||
github.com/eclipse/paho.mqtt.golang v1.4.3
|
||||
github.com/enbility/cemd v0.2.2
|
||||
github.com/enbility/eebus-go v0.2.0
|
||||
github.com/evcc-io/tesla-proxy-client v0.0.0-20240217133531-c8fc01cb2151
|
||||
github.com/evcc-io/tesla-proxy-client v0.0.0-20240219081629-3afc7df83f15
|
||||
github.com/fatih/structs v1.1.0
|
||||
github.com/glebarez/sqlite v1.10.0
|
||||
github.com/go-http-utils/etag v0.0.0-20161124023236-513ea8f21eb1
|
||||
|
|
|
|||
4
go.sum
4
go.sum
|
|
@ -134,8 +134,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
|
|||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/evcc-io/modbus v0.0.0-20230705160100-23e1df2c01c3 h1:QBtLqy85cy9KLRWqKxX+42bN1rWti8iU7pL7Vwf2UbE=
|
||||
github.com/evcc-io/modbus v0.0.0-20230705160100-23e1df2c01c3/go.mod h1:qVX2WhsI5xyAoM6I/MV1bXSKBPdLAjp7pCvieO/S0AY=
|
||||
github.com/evcc-io/tesla-proxy-client v0.0.0-20240217133531-c8fc01cb2151 h1:nnRPTOA++dAAzY/bOJbsXquI1UgSXey4k8so2i6o96E=
|
||||
github.com/evcc-io/tesla-proxy-client v0.0.0-20240217133531-c8fc01cb2151/go.mod h1:zWtAweBqXJTk3HSrPSecz3Q3a2hAUQ4vOE6paJfn03I=
|
||||
github.com/evcc-io/tesla-proxy-client v0.0.0-20240219081629-3afc7df83f15 h1:KWuX06b4nUyghzzN9QpAzC7kCW8Re9uL4ceZ1N04qGQ=
|
||||
github.com/evcc-io/tesla-proxy-client v0.0.0-20240219081629-3afc7df83f15/go.mod h1:zWtAweBqXJTk3HSrPSecz3Q3a2hAUQ4vOE6paJfn03I=
|
||||
github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ func addInstance(subject string, identity *Identity) {
|
|||
// apiError converts HTTP 408 error to ErrTimeout
|
||||
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(), "408 Request Timeout") || strings.HasSuffix(err.Error(), "408 (Request Timeout)")) ||
|
||||
strings.HasSuffix(err.Error(), "vehicle is offline or asleep") {
|
||||
err = api.ErrAsleep
|
||||
}
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue