Support podcast episodes as Sonos favorites (#25087)

This commit is contained in:
Anders Melchiorsen 2019-07-12 07:08:57 +02:00 committed by GitHub
parent d47905d119
commit 6173d7c8a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 6 deletions

View File

@ -4,7 +4,7 @@
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/components/sonos", "documentation": "https://www.home-assistant.io/components/sonos",
"requirements": [ "requirements": [
"pysonos==0.0.19" "pysonos==0.0.20"
], ],
"dependencies": [], "dependencies": [],
"ssdp": { "ssdp": {

View File

@ -371,9 +371,15 @@ class SonosEntity(MediaPlayerDevice):
def _set_favorites(self): def _set_favorites(self):
"""Set available favorites.""" """Set available favorites."""
favorites = self.soco.music_library.get_sonos_favorites() self._favorites = []
# Exclude favorites that are non-playable due to no linked resources for fav in self.soco.music_library.get_sonos_favorites():
self._favorites = [f for f in favorites if f.reference.resources] try:
# Exclude non-playable favorites with no linked resources
if fav.reference.resources:
self._favorites.append(fav)
except SoCoException as ex:
# Skip unknown types
_LOGGER.error("Unhandled favorite '%s': %s", fav.title, ex)
def _radio_artwork(self, url): def _radio_artwork(self, url):
"""Return the private URL with artwork for a radio stream.""" """Return the private URL with artwork for a radio stream."""

View File

@ -1378,7 +1378,7 @@ pysmarty==0.8
pysnmp==4.4.9 pysnmp==4.4.9
# homeassistant.components.sonos # homeassistant.components.sonos
pysonos==0.0.19 pysonos==0.0.20
# homeassistant.components.spc # homeassistant.components.spc
pyspcwebgw==0.4.0 pyspcwebgw==0.4.0

View File

@ -298,7 +298,7 @@ pysmartapp==0.3.2
pysmartthings==0.6.9 pysmartthings==0.6.9
# homeassistant.components.sonos # homeassistant.components.sonos
pysonos==0.0.19 pysonos==0.0.20
# homeassistant.components.spc # homeassistant.components.spc
pyspcwebgw==0.4.0 pyspcwebgw==0.4.0