custom-components / sensor.radarr_upcoming_media

🎬 Radarr component to feed Upcoming Media Card.
Apache License 2.0
59 stars 24 forks source link

radarr upcoming media no longer available #38

Closed farstreet closed 5 months ago

farstreet commented 5 months ago

Describe the Bug Since a few weeks, I'm getting the following error constantly in the logs of home assistant:

2024-05-20 15:15:54.542 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1029, in _update_entity_states
    await entity.async_update_ha_state(True)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 968, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1071, in __async_calculate_state
    if extra_state_attributes := self.extra_state_attributes:
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/radarr_upcoming_media/sensor.py", line 113, in extra_state_attributes
    if 'ratings' in movie and movie['ratings']['rottenTomatoes']['value'] > 0:
                             ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'rottenTomatoes'

The Error see above

Indicate if you followed all steps in the troubleshooting doc didn't update anything to my configuration

What data does the sensor display if any? Feel free to censor information pertaining to titles, networks, etc.

What displays when visiting the API URL from the troubleshooting guide? Feel free to censor information pertaining to titles, networks, etc.

Does the default Home Assistant Radarr component work for you? yes

Home Assistant Version latest

Additional Context Add any other context about the problem here.

mkanet commented 5 months ago

Hi Thank you for letting me know. This was an inadvertent mistake in the last update (that added support for configuring via Home Assistant GUI). Re-download the latest version from HACS to get the fix.

Let me know how it goes.

markwoodward86 commented 5 months ago

@mkanet FYI I tried this and all is working again now