From 260ad4ce106ab0ad5640f4b0ad86fab6eb1df9e6 Mon Sep 17 00:00:00 2001 From: Jakob Schlyter Date: Sat, 4 Jan 2025 21:21:08 +0100 Subject: [PATCH] Remove refresh argument (always try to refresh) --- custom_components/polestar_api/pypolestar/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/polestar_api/pypolestar/auth.py b/custom_components/polestar_api/pypolestar/auth.py index d3802c7..ed90f5e 100644 --- a/custom_components/polestar_api/pypolestar/auth.py +++ b/custom_components/polestar_api/pypolestar/auth.py @@ -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 ( @@ -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")