From c3f63e0739886dbcfcafa308c8def84a4a5de2a0 Mon Sep 17 00:00:00 2001 From: Adam Liddell Date: Tue, 14 Jul 2020 19:37:08 +0100 Subject: [PATCH] Fix media_content_id attribute in Spotify integration (#37853) Previously, the media_content_id field would contain the track name, which appears was a regression when the Spotify integration was rewritten in 7e4b9adc. The media_content_id now reverts to containing the Spotify track 'uri' field, which has the form 'spotify:track:...' --- homeassistant/components/spotify/media_player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/spotify/media_player.py b/homeassistant/components/spotify/media_player.py index 1b74855c9f9..0446500dba2 100644 --- a/homeassistant/components/spotify/media_player.py +++ b/homeassistant/components/spotify/media_player.py @@ -167,7 +167,7 @@ class SpotifyMediaPlayer(MediaPlayerEntity): def media_content_id(self) -> Optional[str]: """Return the media URL.""" item = self._currently_playing.get("item") or {} - return item.get("name") + return item.get("uri") @property def media_content_type(self) -> Optional[str]: