Skip to content

Commit

Permalink
Fix warnings from get_alarms
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Dec 23, 2024
1 parent 1959704 commit 08ac1a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions custom_components/yandex_station/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,8 @@ async def async_update(self):
break
else:
self.next_event = None
except Exception as 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)
except:
pass

async def async_get_events(
self, hass: HomeAssistant, start_date: datetime, end_date: datetime
Expand Down
2 changes: 1 addition & 1 deletion custom_components/yandex_station/core/yandex_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ 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
else:
elif not url.endswith("/get_alarms"):
_LOGGER.warning(f"{url} return {r.status} status")

if retry:
Expand Down

0 comments on commit 08ac1a2

Please sign in to comment.