Reconnect on any ScreenLogic exception (#89269)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Kevin Worrel 2023-03-11 14:27:33 -05:00 committed by GitHub
parent 8564768d9e
commit 56454c8580
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -159,11 +159,9 @@ class ScreenlogicDataUpdateCoordinator(DataUpdateCoordinator):
"""Fetch data from the Screenlogic gateway."""
try:
await self._async_update_configured_data()
except ScreenLogicError as error:
_LOGGER.warning("Update error - attempting reconnect: %s", error)
except (ScreenLogicError, ScreenLogicWarning) as ex:
_LOGGER.warning("Update error - attempting reconnect: %s", ex)
await self._async_reconnect_update_data()
except ScreenLogicWarning as warn:
raise UpdateFailed(f"Incomplete update: {warn}") from warn
return None