From 097bf49a2b2d82f88c8ed1ef5fe431997eea3425 Mon Sep 17 00:00:00 2001 From: Jozef Kruszynski Date: Wed, 3 Jan 2024 17:14:15 +0100 Subject: [PATCH] Fix list issue for async_play_media --- custom_components/mass/media_player.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/mass/media_player.py b/custom_components/mass/media_player.py index c9670ed7..6b51a884 100644 --- a/custom_components/mass/media_player.py +++ b/custom_components/mass/media_player.py @@ -397,13 +397,13 @@ async def async_clear_playlist(self) -> None: async def async_play_media( self, media_type: str, - media_id: str, + media_id: str | list[str], enqueue: MediaPlayerEnqueue | None = None, announce: bool | None = None, **kwargs: Any, ) -> None: """Send the play_media command to the media player.""" - if media_source.is_media_source_id(media_id): + if isinstance(media_id, str) and media_source.is_media_source_id(media_id): # Handle media_source sourced_media = await media_source.async_resolve_media( self.hass, media_id, self.entity_id @@ -413,7 +413,7 @@ async def async_play_media( # forward to our advanced play_media handler await self._async_play_media_advanced( - media_id=[media_id], + media_id=media_id if isinstance(media_id, list) else [media_id], enqueue=enqueue, announce=announce, media_type=media_type,