koying / jellyfin_ha

Jellyfin integration for Home Assistant
Apache License 2.0
105 stars 18 forks source link

Handle temporarily unavailable server gracefully #11

Closed allthesebugsv2 closed 3 years ago

allthesebugsv2 commented 3 years ago

Hi! My Jellyfin host is not available 24/7 but rather is suspended on a timer. Now when the host goes into suspend all states of the entities freeze while they should probably change to something like "unavailable".

Furthermore the HA log is spammed with hundreds of messages like these "Failed to connect to server" followed by a traceback and many more follow-up errors like "Failed to login to server with status code: 502". It would be really sweet if jellyfin_ha could handle this situation a bit cleaner. Thank you in any case for the great integration, works already much better than emby HA!

koying commented 3 years ago

Could you provide a log, please. Numerous errors come from the supporting library, where I can't do much, but I see no traceback in my tests.

allthesebugsv2 commented 3 years ago

Here you go: https://pastebin.com/B95Cxavx

Hope this helps!

koying commented 3 years ago

I created a new release with some improvements.

I cannot do anything about the errors of the supporting library, though. You could hide them via, e.g.

logger:
  ...
  logs:
    JELLYFIN.jellyfin_apiclient_python.api: critical
allthesebugsv2 commented 3 years ago

That was quick, thank you very much! And also thank you for that line to hide the errors.