Fix "not-logged" edge cases for Comelit VEDO (#107741)

This commit is contained in:
Simone Chemelli 2024-01-12 09:56:13 +01:00 committed by GitHub
parent e7628d23d2
commit 79254c6867
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 9 deletions

View File

@ -81,15 +81,11 @@ class ComelitBaseCoordinator(DataUpdateCoordinator[dict[str, Any]]):
try: try:
await self.api.login() await self.api.login()
return await self._async_update_system_data() return await self._async_update_system_data()
except exceptions.CannotConnect as err: except (exceptions.CannotConnect, exceptions.CannotRetrieveData) as err:
_LOGGER.warning("Connection error for %s", self._host) raise UpdateFailed(repr(err)) from err
await self.api.close()
raise UpdateFailed(f"Error fetching data: {repr(err)}") from err
except exceptions.CannotAuthenticate: except exceptions.CannotAuthenticate:
raise ConfigEntryAuthFailed raise ConfigEntryAuthFailed
return {}
@abstractmethod @abstractmethod
async def _async_update_system_data(self) -> dict[str, Any]: async def _async_update_system_data(self) -> dict[str, Any]:
"""Class method for updating data.""" """Class method for updating data."""

View File

@ -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.7.0"] "requirements": ["aiocomelit==0.7.3"]
} }

View File

@ -215,7 +215,7 @@ aiobafi6==0.9.0
aiobotocore==2.6.0 aiobotocore==2.6.0
# homeassistant.components.comelit # homeassistant.components.comelit
aiocomelit==0.7.0 aiocomelit==0.7.3
# homeassistant.components.dhcp # homeassistant.components.dhcp
aiodiscover==1.6.0 aiodiscover==1.6.0

View File

@ -194,7 +194,7 @@ aiobafi6==0.9.0
aiobotocore==2.6.0 aiobotocore==2.6.0
# homeassistant.components.comelit # homeassistant.components.comelit
aiocomelit==0.7.0 aiocomelit==0.7.3
# homeassistant.components.dhcp # homeassistant.components.dhcp
aiodiscover==1.6.0 aiodiscover==1.6.0