mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Address late review comments for Comelit login (#102768)
This commit is contained in:
parent
dfc454d527
commit
4328f887be
@ -68,15 +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)
|
||||
logged = False
|
||||
try:
|
||||
logged = await self.api.login()
|
||||
await self.api.login()
|
||||
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
|
||||
finally:
|
||||
if not logged:
|
||||
raise ConfigEntryAuthFailed
|
||||
except exceptions.CannotAuthenticate:
|
||||
raise ConfigEntryAuthFailed
|
||||
|
||||
return await self.api.get_all_devices()
|
||||
|
Loading…
x
Reference in New Issue
Block a user