mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Handle server disconnection for Comelit devices (#104583)
This commit is contained in:
parent
31cab5803c
commit
fc7b17d35b
@ -68,13 +68,13 @@ class ComelitSerialBridge(DataUpdateCoordinator):
|
||||
async def _async_update_data(self) -> dict[str, Any]:
|
||||
"""Update device data."""
|
||||
_LOGGER.debug("Polling Comelit Serial Bridge host: %s", self._host)
|
||||
|
||||
try:
|
||||
await self.api.login()
|
||||
return await self.api.get_all_devices()
|
||||
except exceptions.CannotConnect as err:
|
||||
_LOGGER.warning("Connection error for %s", self._host)
|
||||
await self.api.close()
|
||||
raise UpdateFailed(f"Error fetching data: {repr(err)}") from err
|
||||
except exceptions.CannotAuthenticate:
|
||||
raise ConfigEntryAuthFailed
|
||||
|
||||
return await self.api.get_all_devices()
|
||||
|
@ -6,5 +6,5 @@
|
||||
"documentation": "https://www.home-assistant.io/integrations/comelit",
|
||||
"iot_class": "local_polling",
|
||||
"loggers": ["aiocomelit"],
|
||||
"requirements": ["aiocomelit==0.5.2"]
|
||||
"requirements": ["aiocomelit==0.6.2"]
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ aiobafi6==0.9.0
|
||||
aiobotocore==2.6.0
|
||||
|
||||
# homeassistant.components.comelit
|
||||
aiocomelit==0.5.2
|
||||
aiocomelit==0.6.2
|
||||
|
||||
# homeassistant.components.dhcp
|
||||
aiodiscover==1.5.1
|
||||
|
@ -191,7 +191,7 @@ aiobafi6==0.9.0
|
||||
aiobotocore==2.6.0
|
||||
|
||||
# homeassistant.components.comelit
|
||||
aiocomelit==0.5.2
|
||||
aiocomelit==0.6.2
|
||||
|
||||
# homeassistant.components.dhcp
|
||||
aiodiscover==1.5.1
|
||||
|
Loading…
x
Reference in New Issue
Block a user