mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 06:17:07 +00:00
Improve Comelit login with PIN (#100860)
* improve login * library bump
This commit is contained in:
parent
0afb060c24
commit
db5943ad6d
@ -71,16 +71,14 @@ class ComelitSerialBridge(DataUpdateCoordinator):
|
|||||||
async def _async_update_data(self) -> dict[str, Any]:
|
async def _async_update_data(self) -> dict[str, Any]:
|
||||||
"""Update router data."""
|
"""Update router data."""
|
||||||
_LOGGER.debug("Polling Comelit Serial Bridge host: %s", self._host)
|
_LOGGER.debug("Polling Comelit Serial Bridge host: %s", self._host)
|
||||||
|
logged = False
|
||||||
try:
|
try:
|
||||||
logged = await self.api.login()
|
logged = await self.api.login()
|
||||||
except (asyncio.exceptions.TimeoutError, aiohttp.ClientConnectorError) as err:
|
except (asyncio.exceptions.TimeoutError, aiohttp.ClientConnectorError) as err:
|
||||||
_LOGGER.warning("Connection error for %s", self._host)
|
_LOGGER.warning("Connection error for %s", self._host)
|
||||||
raise UpdateFailed(f"Error fetching data: {repr(err)}") from err
|
raise UpdateFailed(f"Error fetching data: {repr(err)}") from err
|
||||||
|
finally:
|
||||||
if not logged:
|
if not logged:
|
||||||
raise ConfigEntryAuthFailed
|
raise ConfigEntryAuthFailed
|
||||||
|
|
||||||
devices_data = await self.api.get_all_devices()
|
return await self.api.get_all_devices()
|
||||||
await self.api.logout()
|
|
||||||
|
|
||||||
return devices_data
|
|
||||||
|
@ -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.0.8"]
|
"requirements": ["aiocomelit==0.0.9"]
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ aiobafi6==0.9.0
|
|||||||
aiobotocore==2.6.0
|
aiobotocore==2.6.0
|
||||||
|
|
||||||
# homeassistant.components.comelit
|
# homeassistant.components.comelit
|
||||||
aiocomelit==0.0.8
|
aiocomelit==0.0.9
|
||||||
|
|
||||||
# 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.0.8
|
aiocomelit==0.0.9
|
||||||
|
|
||||||
# homeassistant.components.dhcp
|
# homeassistant.components.dhcp
|
||||||
aiodiscover==1.5.1
|
aiodiscover==1.5.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user