Skip to content

Commit

Permalink
move can_retry_login back to login function (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
stonith authored Jun 26, 2022
1 parent 5efc7d0 commit 1b0e6ba
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 1b0e6ba

Please sign in to comment.