gcorgnet / sensor.emby_upcoming_media

Home Assistant component to feed Upcoming Media Card with the latest releases on an Emby instance.
MIT License
22 stars 17 forks source link

Sensors only updating when reboot Home Assistant #27

Open feinen opened 1 year ago

feinen commented 1 year ago

Sensors only updates when i reboot Home Assistant.

Logger: homeassistant.components.sensor Source: custom_components/emby_upcoming_media/sensor.py:152 Integration: Sensor (documentation, issues) First occurred: 11:43:32 AM (2 occurrences) Last logged: 11:43:33 AM

Error adding entities for domain sensor with platform emby_upcoming_media Error while setting up emby_upcoming_media platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 586, in _async_write_ha_state attr.update(self.extra_state_attributes or {}) File "/config/custom_components/emby_upcoming_media/sensor.py", line 247, in extra_state_attributes return self.handle_tv_show() File "/config/custom_components/emby_upcoming_media/sensor.py", line 152, in handle_tv_show card_item["title"] = show["SeriesName"] KeyError: 'SeriesName'

ZenyoMaarten commented 1 year ago

Same over here 🙄

feinen commented 1 year ago

Found a workaround for this.

use a automation to call this service to refresh:

service: homeassistant.update_entity data: {} target: entity_id: sensor.emby_latest_tv