From 2a8444b245213492da827582fa7aa83b6484fdda Mon Sep 17 00:00:00 2001 From: David Bonnes Date: Sun, 7 Jan 2024 19:04:14 +0000 Subject: [PATCH] Fix evohome high_precision temps not retreived consistently (#107366) * initial commit * doctweak * remove hint * doctweak --- homeassistant/components/evohome/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/evohome/__init__.py b/homeassistant/components/evohome/__init__.py index 06712a83b6af..390bdeb3f333 100644 --- a/homeassistant/components/evohome/__init__.py +++ b/homeassistant/components/evohome/__init__.py @@ -497,7 +497,6 @@ class EvoBroker: session_id = get_session_id(self.client_v1) - self.temps = {} # these are now stale, will fall back to v2 temps try: temps = await self.client_v1.get_temperatures() @@ -523,6 +522,11 @@ class EvoBroker: ), err, ) + self.temps = {} # high-precision temps now considered stale + + except Exception: + self.temps = {} # high-precision temps now considered stale + raise else: if str(self.client_v1.location_id) != self._location.locationId: @@ -654,6 +658,7 @@ class EvoChild(EvoDevice): assert isinstance(self._evo_device, evo.HotWater | evo.Zone) # mypy check if self._evo_broker.temps.get(self._evo_id) is not None: + # use high-precision temps if available return self._evo_broker.temps[self._evo_id] return self._evo_device.temperature