Add Tado error handling to fetching devices (#105546)

This commit is contained in:
Erwin Douna 2023-12-12 10:55:22 +01:00 committed by GitHub
parent 9d44dc4437
commit fb615817b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -181,7 +181,12 @@ class TadoConnector:
def update_devices(self):
"""Update the device data from Tado."""
devices = self.tado.getDevices()
try:
devices = self.tado.getDevices()
except RuntimeError:
_LOGGER.error("Unable to connect to Tado while updating devices")
return
for device in devices:
device_short_serial_no = device["shortSerialNo"]
_LOGGER.debug("Updating device %s", device_short_serial_no)