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

Update code type handling #270

Merged
merged 1 commit into from
Dec 15, 2024
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
6 changes: 3 additions & 3 deletions custom_components/polestar_api/pypolestar/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ async def get_token(self, refresh=False) -> None:

self.logger.debug("Access token updated, valid until %s", self.token_expiry)

async def _get_code(self) -> None:
async def _get_code(self) -> str | None:
query_params = await self._get_resume_path()

# check if code is in query_params
if query_params.get("code"):
return query_params.get("code")
if code := query_params.get("code"):
return code

# get the resume path
if not (resume_path := query_params.get("resumePath")):
Expand Down
Loading