-
-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Trigger reauth on UniFi authentication errors #183033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
648e6da
660fd1c
620dec1
268b139
5f34f1b
5d4e948
de33dd9
c61e9ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,10 +3,11 @@ | |
| from datetime import timedelta | ||
| from typing import TYPE_CHECKING, override | ||
|
|
||
| from aiounifi import EndpointNotFound | ||
| from aiounifi import EndpointNotFound, LoginRequired, Unauthorized | ||
| from aiounifi.interfaces.api_handlers import APIHandler, ItemEvent | ||
|
|
||
| from homeassistant.core import callback | ||
| from homeassistant.exceptions import ConfigEntryAuthFailed | ||
| from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed | ||
|
|
||
| from .const import LOGGER | ||
|
|
@@ -57,6 +58,8 @@ async def _async_update_data(self) -> None: | |
| """Update data from the API handler.""" | ||
| try: | ||
| await self._handler.update() | ||
| except (Unauthorized, LoginRequired) as err: | ||
| raise ConfigEntryAuthFailed(str(err)) from err | ||
|
Comment on lines
+61
to
+62
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each coordinator stops itself: |
||
| except EndpointNotFound as err: | ||
| if ( | ||
| self._disable_polling_on_endpoint_not_found | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might also happen on situations as when restarting the console so not sure this is the correct solution, it might introduce other issues