Skip to content

Commit

Permalink
Remove refresh argument (always try to refresh)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter committed Jan 4, 2025
1 parent 62ea834 commit 260ad4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/polestar_api/pypolestar/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def is_token_valid(self) -> bool:
and self.token_expiry > datetime.now(tz=timezone.utc)
)

async def get_token(self, refresh: bool = True, force: bool = False) -> None:
async def get_token(self, force: bool = False) -> None:
"""Ensure we have a valid access token (still valid, refreshed or initial)."""

if (
Expand All @@ -113,7 +113,7 @@ async def get_token(self, refresh: bool = True, force: bool = False) -> None:
self.logger.debug("Token still valid until %s", self.token_expiry)
return

if refresh and self.refresh_token:
if self.refresh_token:
try:
await self._token_refresh()
self.logger.debug("Token refreshed")
Expand Down

0 comments on commit 260ad4c

Please sign in to comment.