Carwings: silence ErrClimateStatusUnavailable errors (#3776)
This commit is contained in:
parent
5332148fc1
commit
b8b54a7b77
3 changed files with 12 additions and 3 deletions
5
go.mod
5
go.mod
|
|
@ -171,4 +171,7 @@ require (
|
|||
nhooyr.io/websocket v1.8.7 // indirect
|
||||
)
|
||||
|
||||
replace github.com/foogod/go-powerwall => github.com/andig/go-powerwall v0.2.1-0.20220205120646-e5220ad9a9a0
|
||||
replace (
|
||||
github.com/foogod/go-powerwall => github.com/andig/go-powerwall v0.2.1-0.20220205120646-e5220ad9a9a0
|
||||
github.com/joeshaw/carwings => github.com/andig/carwings v0.0.0-20220705135220-84815910cf7d
|
||||
)
|
||||
|
|
|
|||
4
go.sum
4
go.sum
|
|
@ -88,6 +88,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
|
|||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/alvaroloes/enumer v1.1.2 h1:5khqHB33TZy1GWCO/lZwcroBFh7u+0j40T83VUbfAMY=
|
||||
github.com/alvaroloes/enumer v1.1.2/go.mod h1:FxrjvuXoDAx9isTJrv4c+T410zFi0DtXIT0m65DJ+Wo=
|
||||
github.com/andig/carwings v0.0.0-20220705135220-84815910cf7d h1:mL5iaUrMlLQscY7PK3236SIQICVBIT6M39mDM0IttUI=
|
||||
github.com/andig/carwings v0.0.0-20220705135220-84815910cf7d/go.mod h1:tB0OlpicmRVTL1Vksc5XRiYo+wkK2kl/GI7eGMIl6Rs=
|
||||
github.com/andig/go-powerwall v0.2.1-0.20220205120646-e5220ad9a9a0 h1:9fQ/afZNwqEnlAfozBiROWew2FjF2PctrEUVxUncM0Q=
|
||||
github.com/andig/go-powerwall v0.2.1-0.20220205120646-e5220ad9a9a0/go.mod h1:NA12RXBKXFQFx3Nb9xMTQjHIphu1Fl64i/gQMuRdMZc=
|
||||
github.com/andig/gosunspec v0.0.0-20211108155140-af2e73b86e71 h1:tnjVNZjuz+CK6fdc7ohJpMHjcEGFI5APp0l5T5Ocr/Y=
|
||||
|
|
@ -525,8 +527,6 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y
|
|||
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
|
||||
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
|
||||
github.com/joeshaw/carwings v0.0.0-20220225151533-185ade10e0de h1:EYELjD+Ab2JIOhgFuOm2a1P8+i9TA+iQEatjM949elA=
|
||||
github.com/joeshaw/carwings v0.0.0-20220225151533-185ade10e0de/go.mod h1:tB0OlpicmRVTL1Vksc5XRiYo+wkK2kl/GI7eGMIl6Rs=
|
||||
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
|
||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||
github.com/jpfielding/go-http-digest v0.0.0-20211006141426-fbc93758452e h1:iLmt7czLE9ophoU4xZcckVNCXp+auTvVSQ9MGTWbgBY=
|
||||
|
|
|
|||
|
|
@ -221,6 +221,12 @@ var _ api.VehicleClimater = (*CarWings)(nil)
|
|||
func (v *CarWings) Climater() (active bool, outsideTemp float64, targetTemp float64, err error) {
|
||||
res, err := v.climateG()
|
||||
|
||||
// silence ErrClimateStatusUnavailable errors
|
||||
if errors.Is(err, carwings.ErrClimateStatusUnavailable) {
|
||||
res.Temperature = 21
|
||||
err = nil
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
active = res.Running
|
||||
targetTemp = float64(res.Temperature)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue