Bump nettigo-air-monitor to version 2.1.0 (#88569)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Maciej Bieniek 2023-02-22 00:41:46 +01:00 committed by GitHub
parent 356c316b39
commit a54e523731
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 21 deletions

View file

@ -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(