From 56f9ccb877a386f97eb17220271d5397dc246787 Mon Sep 17 00:00:00 2001 From: Riccardo Canta Date: Wed, 30 Aug 2017 15:10:02 +0200 Subject: [PATCH] Allow sonos to select album as a source (#9221) Importing the fix in the PR https://github.com/home-assistant/home-assistant/pull/8258 I noticed that the same error is present also for Spotify album so I have extended the code and tested it. It works fine on my setup --- homeassistant/components/media_player/sonos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/media_player/sonos.py b/homeassistant/components/media_player/sonos.py index 63d27299aa7..03be42d07ff 100644 --- a/homeassistant/components/media_player/sonos.py +++ b/homeassistant/components/media_player/sonos.py @@ -897,7 +897,8 @@ class SonosDevice(MediaPlayerDevice): src = fav.pop() self._source_name = src['title'] - if 'object.container.playlistContainer' in src['meta']: + if ('object.container.playlistContainer' in src['meta'] or + 'object.container.album.musicAlbum' in src['meta']): self._replace_queue_with_playlist(src) self._player.play_from_queue(0) else: