Skip to content

Commit 4c8ee77

Browse files
iMicknlCopilot
andcommitted
Refactor login method in OverkizClient to return None and update docstring with error handling details
Co-authored-by: Copilot <copilot@github.com>
1 parent 80657bf commit 4c8ee77

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

pyoverkiz/client.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,15 @@ async def close(self) -> None:
276276
async def login(
277277
self,
278278
register_event_listener: bool = True,
279-
) -> bool:
279+
) -> None:
280280
"""Authenticate and create an API session allowing access to the other operations.
281281
282282
Caller must provide one of [userId+userPassword, userId+ssoToken, accessToken, jwt].
283+
284+
Raises:
285+
BadCredentialsError: When the provided credentials are invalid.
286+
TooManyAttemptsBannedError: When too many failed login attempts have been made.
287+
TooManyRequestsError: When the API rate limit has been exceeded.
283288
"""
284289
await self._auth.login()
285290

@@ -290,12 +295,12 @@ async def login(
290295
# Validate local API token by calling a simple endpoint
291296
await self.get_gateways()
292297

293-
return True
298+
return
294299

295300
if register_event_listener:
296301
await self.register_event_listener()
297302

298-
return True
303+
return
299304

300305
@retry_on_auth_error
301306
async def get_setup(self, refresh: bool = False) -> Setup:

0 commit comments

Comments
 (0)