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

Component Not Creating Sensor for Latest TV Shows #1

Closed coopermf closed 4 years ago

coopermf commented 5 years ago

Hey, I tried out this custom component today with the newest version of the Upcoming Media Card and really appreciate all the work. However, the component seems to be working for fetching the latest Movies and displaying them properly in the card but fails to create a sensor for the latest TV shows added. I'm a noob to most of this stuff but let me know if there's anything I can do to help debug. I've attached my home assistant logs and this is what my config file looks like

sensor:

home-assistant.log

gcorgnet commented 5 years ago

Hey, what is the actual name of your library in Emby? Is it "TV" ? Alternatively, you could remove the "include" (it's optinal) and let the sensor pull all libraries. Does that work as expected?

coopermf commented 5 years ago

Yes, the library is just named "TV" but removing include from the config yields the same result. Only sensor.emby_latest_movies is created.

coopermf commented 5 years ago

Actually this is not quite true, it also generates sensor.emby_latest_playlists but fails to generate a sensor for my libraries "TV" and "Music"

TheRealLouCipher commented 5 years ago

I also get this. Sensor for tv shows fails to setup. Logs shows the following:


Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 408, in _async_add_entity
    await entity.async_update_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 275, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 317, in _async_write_ha_state
    attr.update(self.device_state_attributes or {})
  File "/config/custom_components/emby_upcoming_media/sensor.py", line 145, in device_state_attributes
    timeobject = timedelta(microseconds=show["RunTimeTicks"] / 10)
KeyError: 'RunTimeTicks'
TheDave1022 commented 4 years ago

I have a similar issue. I get 3 categories created out of 6 when not including any includes. sensor.emby_latest_collections sensor.emby_latest_live_tv sensor.emby_latest_movies

I'm missing TV shows, Recordings, and Music from detecting. I'm able to view this data from the API http://{server}:8096/Users/{user_id}/Views

TheDave1022 commented 4 years ago

Working now. Thanks!

LEJOUI commented 4 years ago

I'm having a similar error for the movies.

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 434, in _async_add_entity await entity.async_update_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 284, in async_update_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 328, in _async_write_ha_state attr.update(self.device_state_attributes or {}) File "/config/custom_components/emby_upcoming_media/sensor.py", line 145, in device_state_attributes timeobject = timedelta(microseconds=show["RunTimeTicks"] / 10) KeyError: 'RunTimeTicks'

TheRealLouCipher commented 4 years ago

@LEJOUI Have you updated the sensor.py? There's no new release that contains the fix unfortunately.

LEJOUI commented 4 years ago

Thanks. I thought it only was a fix for the tv series. But it did also solve the problem for the movies.

gcorgnet commented 4 years ago

I released that fix, sorry about the delay.