From 5cd61a0cf4890cd79396d3da2cc10f01512e5e55 Mon Sep 17 00:00:00 2001 From: David Bonnes Date: Mon, 6 Nov 2023 15:17:28 +0100 Subject: [PATCH] Remove redundant code from the evohome integration (#103508) * remove unreachable except clause * remove uneccesary try --- homeassistant/components/evohome/__init__.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/homeassistant/components/evohome/__init__.py b/homeassistant/components/evohome/__init__.py index b848bc0f02c..b47e86dd501 100644 --- a/homeassistant/components/evohome/__init__.py +++ b/homeassistant/components/evohome/__init__.py @@ -497,18 +497,6 @@ 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) @@ -519,7 +507,7 @@ class EvoBroker: "the v1 API's default location (there is more than one location), " "so the high-precision feature will be disabled until next restart" ) - self.client_v1 = self.temps = None + self.temps = self.client_v1 = None else: self.temps = {str(i["id"]): i["temp"] for i in temps} @@ -556,10 +544,7 @@ class EvoBroker: await self._update_v2_api_state() if self.client_v1: - try: - await self._update_v1_api_temps() - except evohomeasync.EvohomeError: - self.temps = None # these are now stale, will fall back to v2 temps + await self._update_v1_api_temps() class EvoDevice(Entity):