Skip to content
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

move can_retry_login back to login function #147

Merged
merged 1 commit into from
Jun 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aiounifi/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(
self.site = site
self.sslcontext = sslcontext
self.callback = callback
self.can_retry_login = True
self.can_retry_login = False

self.url = f"https://{self.host}:{self.port}"
self.is_unifi_os = False
Expand Down Expand Up @@ -128,6 +128,7 @@ async def login(self) -> None:
}

await self._request("post", url=url, json=auth)
self.can_retry_login = True
if (
(response := self.last_response) is not None
and response.status == HTTPStatus.OK
Expand Down