diff --git a/custom_components/polestar_api/polestar.py b/custom_components/polestar_api/polestar.py index 791edb0..67ed7d7 100644 --- a/custom_components/polestar_api/polestar.py +++ b/custom_components/polestar_api/polestar.py @@ -2,6 +2,8 @@ from datetime import timedelta import logging +from .pypolestar.exception import PolestarApiException + from .pypolestar.polestar import PolestarApi from urllib3 import disable_warnings @@ -45,7 +47,10 @@ def get_latest_call_code(self): return self.polestarApi.latest_call_code async def async_update(self) -> None: - await self.polestarApi.get_ev_data(self.vin) + try: + await self.polestarApi.get_ev_data(self.vin) + except PolestarApiException as e: + _LOGGER.warning("API Exception on update data %s", str(e)) def get_value(self, query: str, field_name: str, skip_cache: bool = False): data = self.polestarApi.get_cache_data(query, field_name, skip_cache)