From eb1a9eda60fad75b06c0bc72f9612a6409db4c97 Mon Sep 17 00:00:00 2001 From: David Bonnes Date: Mon, 3 Jun 2024 20:48:48 +0100 Subject: [PATCH] Harden evohome against failures to retrieve zone schedules (#118517) --- homeassistant/components/evohome/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/evohome/__init__.py b/homeassistant/components/evohome/__init__.py index 0b0ef1d1c0d..72e4dd5d83b 100644 --- a/homeassistant/components/evohome/__init__.py +++ b/homeassistant/components/evohome/__init__.py @@ -741,16 +741,18 @@ class EvoChild(EvoDevice): assert isinstance(self._evo_device, evo.HotWater | evo.Zone) # mypy check try: - self._schedule = await self._evo_broker.call_client_api( # type: ignore[assignment] + schedule = await self._evo_broker.call_client_api( self._evo_device.get_schedule(), update_state=False ) except evo.InvalidSchedule as err: _LOGGER.warning( - "%s: Unable to retrieve the schedule: %s", + "%s: Unable to retrieve a valid schedule: %s", self._evo_device, err, ) self._schedule = {} + else: + self._schedule = schedule or {} _LOGGER.debug("Schedule['%s'] = %s", self.name, self._schedule)