mirror of
https://github.com/home-assistant/core.git
synced 2025-07-11 07:17:12 +00:00
Remove redundant code from the evohome integration (#103508)
* remove unreachable except clause * remove uneccesary try
This commit is contained in:
parent
b0e04ae690
commit
5cd61a0cf4
@ -497,18 +497,6 @@ class EvoBroker:
|
|||||||
)
|
)
|
||||||
self.temps = None # these are now stale, will fall back to v2 temps
|
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:
|
else:
|
||||||
if (
|
if (
|
||||||
str(self.client_v1.location_id)
|
str(self.client_v1.location_id)
|
||||||
@ -519,7 +507,7 @@ class EvoBroker:
|
|||||||
"the v1 API's default location (there is more than one location), "
|
"the v1 API's default location (there is more than one location), "
|
||||||
"so the high-precision feature will be disabled until next restart"
|
"so the high-precision feature will be disabled until next restart"
|
||||||
)
|
)
|
||||||
self.client_v1 = self.temps = None
|
self.temps = self.client_v1 = None
|
||||||
else:
|
else:
|
||||||
self.temps = {str(i["id"]): i["temp"] for i in temps}
|
self.temps = {str(i["id"]): i["temp"] for i in temps}
|
||||||
|
|
||||||
@ -556,10 +544,7 @@ class EvoBroker:
|
|||||||
await self._update_v2_api_state()
|
await self._update_v2_api_state()
|
||||||
|
|
||||||
if self.client_v1:
|
if self.client_v1:
|
||||||
try:
|
await self._update_v1_api_temps()
|
||||||
await self._update_v1_api_temps()
|
|
||||||
except evohomeasync.EvohomeError:
|
|
||||||
self.temps = None # these are now stale, will fall back to v2 temps
|
|
||||||
|
|
||||||
|
|
||||||
class EvoDevice(Entity):
|
class EvoDevice(Entity):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user