mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Fix Kodi play_media media type casing (#38665)
* [KODI] Fix casing issue Alexa and the Services UI on HA feeds in a media type of "channel" for media type. The Kodi code looks for a "CHANNEL" instead, as a result the functionality fails. * Update homeassistant/components/kodi/media_player.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/kodi/media_player.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/kodi/media_player.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update homeassistant/components/kodi/media_player.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> Co-authored-by: Chris Talkington <chris@talkingtontech.com>
This commit is contained in:
parent
f526deaa87
commit
ef039d6a65
@ -774,13 +774,15 @@ class KodiDevice(MediaPlayerEntity):
|
|||||||
@cmd
|
@cmd
|
||||||
async def async_play_media(self, media_type, media_id, **kwargs):
|
async def async_play_media(self, media_type, media_id, **kwargs):
|
||||||
"""Send the play_media command to the media player."""
|
"""Send the play_media command to the media player."""
|
||||||
if media_type == "CHANNEL":
|
media_type_lower = media_type.lower()
|
||||||
|
|
||||||
|
if media_type_lower == MEDIA_TYPE_CHANNEL:
|
||||||
await self.server.Player.Open({"item": {"channelid": int(media_id)}})
|
await self.server.Player.Open({"item": {"channelid": int(media_id)}})
|
||||||
elif media_type == "PLAYLIST":
|
elif media_type_lower == MEDIA_TYPE_PLAYLIST:
|
||||||
await self.server.Player.Open({"item": {"playlistid": int(media_id)}})
|
await self.server.Player.Open({"item": {"playlistid": int(media_id)}})
|
||||||
elif media_type == "DIRECTORY":
|
elif media_type_lower == "directory":
|
||||||
await self.server.Player.Open({"item": {"directory": str(media_id)}})
|
await self.server.Player.Open({"item": {"directory": str(media_id)}})
|
||||||
elif media_type == "PLUGIN":
|
elif media_type_lower == "plugin":
|
||||||
await self.server.Player.Open({"item": {"file": str(media_id)}})
|
await self.server.Player.Open({"item": {"file": str(media_id)}})
|
||||||
else:
|
else:
|
||||||
await self.server.Player.Open({"item": {"file": str(media_id)}})
|
await self.server.Player.Open({"item": {"file": str(media_id)}})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user