Skip to content

Commit

Permalink
Fix evohome high_precision temps not retreived consistently (#107366)
Browse files Browse the repository at this point in the history
* initial commit

* doctweak

* remove hint

* doctweak
  • Loading branch information
zxdavb authored Jan 7, 2024
1 parent 75d5915 commit 2a8444b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion homeassistant/components/evohome/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ def get_session_id(client_v1: ev1.EvohomeClient) -> str | None:

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()

Expand All @@ -523,6 +522,11 @@ def get_session_id(client_v1: ev1.EvohomeClient) -> str | None:
),
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:
Expand Down Expand Up @@ -654,6 +658,7 @@ def current_temperature(self) -> float | None:
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

Expand Down

0 comments on commit 2a8444b

Please sign in to comment.