diff --git a/custom_components/yandex_station/calendar.py b/custom_components/yandex_station/calendar.py index 2cd8333..577d826 100644 --- a/custom_components/yandex_station/calendar.py +++ b/custom_components/yandex_station/calendar.py @@ -62,7 +62,11 @@ async def async_update(self): else: self.next_event = None except Exception as e: - _LOGGER.warning("Не удалось загрузить будильники", exc_info=e) + # https://github.com/AlexxIT/YandexStation/issues/580 + if str(e).endswith("return 500 status"): + _LOGGER.debug(f"Не удалось загрузить будильники: {repr(e)}") + else: + _LOGGER.warning("Не удалось загрузить будильники", exc_info=e) async def async_get_events( self, hass: HomeAssistant, start_date: datetime, end_date: datetime diff --git a/custom_components/yandex_station/core/yandex_session.py b/custom_components/yandex_station/core/yandex_session.py index 313a35a..53039ea 100644 --- a/custom_components/yandex_station/core/yandex_session.py +++ b/custom_components/yandex_station/core/yandex_session.py @@ -488,6 +488,8 @@ async def request(self, method: str, url: str, retry: int = 2, **kwargs): elif r.status == 403: # 403 - no x-csrf-token self.csrf_token = None + elif r.status == 500: + await asyncio.sleep(1) else: _LOGGER.warning(f"{url} return {r.status} status")