Bump nettigo-air-monitor
to version 2.1.0 (#88569)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
356c316b39
commit
a54e523731
7 changed files with 26 additions and 21 deletions
|
@ -11,8 +11,8 @@ from aiohttp.client_exceptions import ClientConnectorError
|
|||
import async_timeout
|
||||
from nettigo_air_monitor import (
|
||||
ApiError,
|
||||
AuthFailed,
|
||||
CannotGetMac,
|
||||
AuthFailedError,
|
||||
CannotGetMacError,
|
||||
ConnectionOptions,
|
||||
NettigoAirMonitor,
|
||||
)
|
||||
|
@ -95,7 +95,7 @@ class NAMFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
config = await async_get_config(self.hass, self.host)
|
||||
except (ApiError, ClientConnectorError, asyncio.TimeoutError):
|
||||
errors["base"] = "cannot_connect"
|
||||
except CannotGetMac:
|
||||
except CannotGetMacError:
|
||||
return self.async_abort(reason="device_unsupported")
|
||||
except Exception: # pylint: disable=broad-except
|
||||
_LOGGER.exception("Unexpected exception")
|
||||
|
@ -127,7 +127,7 @@ class NAMFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
if user_input is not None:
|
||||
try:
|
||||
await async_check_credentials(self.hass, self.host, user_input)
|
||||
except AuthFailed:
|
||||
except AuthFailedError:
|
||||
errors["base"] = "invalid_auth"
|
||||
except (ApiError, ClientConnectorError, asyncio.TimeoutError):
|
||||
errors["base"] = "cannot_connect"
|
||||
|
@ -158,7 +158,7 @@ class NAMFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
self._config = await async_get_config(self.hass, self.host)
|
||||
except (ApiError, ClientConnectorError, asyncio.TimeoutError):
|
||||
return self.async_abort(reason="cannot_connect")
|
||||
except CannotGetMac:
|
||||
except CannotGetMacError:
|
||||
return self.async_abort(reason="device_unsupported")
|
||||
|
||||
await self.async_set_unique_id(format_mac(self._config.mac_address))
|
||||
|
@ -206,7 +206,12 @@ class NAMFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
if user_input is not None:
|
||||
try:
|
||||
await async_check_credentials(self.hass, self.host, user_input)
|
||||
except (ApiError, AuthFailed, ClientConnectorError, asyncio.TimeoutError):
|
||||
except (
|
||||
ApiError,
|
||||
AuthFailedError,
|
||||
ClientConnectorError,
|
||||
asyncio.TimeoutError,
|
||||
):
|
||||
return self.async_abort(reason="reauth_unsuccessful")
|
||||
|
||||
self.hass.config_entries.async_update_entry(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue