diff --git a/intg-kodi/driver.py b/intg-kodi/driver.py index 690b599..ff62550 100644 --- a/intg-kodi/driver.py +++ b/intg-kodi/driver.py @@ -202,7 +202,7 @@ async def on_device_disconnected(device_id: str): ) elif configured_entity.entity_type == ucapi.EntityTypes.REMOTE: api.configured_entities.update_attributes( - entity_id, {ucapi.media_player.Attributes.STATE: ucapi.remote.States.UNAVAILABLE} + entity_id, {ucapi.remote.Attributes.STATE: ucapi.remote.States.UNAVAILABLE} ) # TODO #20 when multiple devices are supported, the device state logic isn't that simple anymore! diff --git a/intg-kodi/kodi.py b/intg-kodi/kodi.py index c271633..6177835 100644 --- a/intg-kodi/kodi.py +++ b/intg-kodi/kodi.py @@ -503,8 +503,16 @@ async def _update_states(self) -> None: self._media_title = media_title updated_data[MediaAttr.MEDIA_TITLE] = self._media_title artists = self._item.get("artist") + season: int|None= self._item.get("season") + episode: int|None = self._item.get("episode") if artists and len(artists) > 0: media_artist = artists[0] + elif (season and season > 0) or (episode and episode > 0): + media_artist = "" + if season and season > 0: + media_artist = "S"+str(season) + if episode and episode > 0: + media_artist += "E"+str(episode) else: media_artist = "" if media_artist != self._media_artist: