Harden evohome against failures to retrieve high-precision temps (#102989)

fix hass-logger-period
This commit is contained in:
David Bonnes 2023-10-29 13:28:35 +01:00 committed by GitHub
parent 2616794e1d
commit 8a87ea5506
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -487,6 +487,18 @@ class EvoBroker:
)
self.temps = None # these are now stale, will fall back to v2 temps
except KeyError as err:
_LOGGER.warning(
(
"Unable to obtain high-precision temperatures. "
"It appears the JSON schema is not as expected, "
"so the high-precision feature will be disabled until next restart."
"Message is: %s"
),
err,
)
self.client_v1 = self.temps = None
else:
if (
str(self.client_v1.location_id)
@ -495,7 +507,7 @@ class EvoBroker:
_LOGGER.warning(
"The v2 API's configured location doesn't match "
"the v1 API's default location (there is more than one location), "
"so the high-precision feature will be disabled"
"so the high-precision feature will be disabled until next restart"
)
self.client_v1 = self.temps = None
else: