mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 13:47:35 +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]:
|
async def _async_update_data(self) -> dict[str, Any]:
|
||||||
"""Update device data."""
|
"""Update device data."""
|
||||||
_LOGGER.debug("Polling Comelit Serial Bridge host: %s", self._host)
|
_LOGGER.debug("Polling Comelit Serial Bridge host: %s", self._host)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await self.api.login()
|
await self.api.login()
|
||||||
|
return await self.api.get_all_devices()
|
||||||
except exceptions.CannotConnect as err:
|
except exceptions.CannotConnect as err:
|
||||||
_LOGGER.warning("Connection error for %s", self._host)
|
_LOGGER.warning("Connection error for %s", self._host)
|
||||||
await self.api.close()
|
await self.api.close()
|
||||||
raise UpdateFailed(f"Error fetching data: {repr(err)}") from err
|
raise UpdateFailed(f"Error fetching data: {repr(err)}") from err
|
||||||
except exceptions.CannotAuthenticate:
|
except exceptions.CannotAuthenticate:
|
||||||
raise ConfigEntryAuthFailed
|
raise ConfigEntryAuthFailed
|
||||||
|
|
||||||
return await self.api.get_all_devices()
|
|
||||||
|
@ -6,5 +6,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/comelit",
|
"documentation": "https://www.home-assistant.io/integrations/comelit",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"loggers": ["aiocomelit"],
|
"loggers": ["aiocomelit"],
|
||||||
"requirements": ["aiocomelit==0.5.2"]
|
"requirements": ["aiocomelit==0.6.2"]
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,7 @@ aiobafi6==0.9.0
|
|||||||
aiobotocore==2.6.0
|
aiobotocore==2.6.0
|
||||||
|
|
||||||
# homeassistant.components.comelit
|
# homeassistant.components.comelit
|
||||||
aiocomelit==0.5.2
|
aiocomelit==0.6.2
|
||||||
|
|
||||||
# homeassistant.components.dhcp
|
# homeassistant.components.dhcp
|
||||||
aiodiscover==1.5.1
|
aiodiscover==1.5.1
|
||||||
|
@ -191,7 +191,7 @@ aiobafi6==0.9.0
|
|||||||
aiobotocore==2.6.0
|
aiobotocore==2.6.0
|
||||||
|
|
||||||
# homeassistant.components.comelit
|
# homeassistant.components.comelit
|
||||||
aiocomelit==0.5.2
|
aiocomelit==0.6.2
|
||||||
|
|
||||||
# homeassistant.components.dhcp
|
# homeassistant.components.dhcp
|
||||||
aiodiscover==1.5.1
|
aiodiscover==1.5.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user