Fix Sonos handling of unsupported favorites (#22906)

This commit is contained in:
Anders Melchiorsen authored and Andrew Sayre committed 2019-04-08 19:32:56 -05:00
1 parent 55c8417ec0
commit d577955d1e
5 files changed
+5 -16

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ from homeassistant.helpers import config_entry_flow
DOMAIN = 'sonos'
REQUIREMENTS = ['pysonos==0.0.8']
REQUIREMENTS = ['pysonos==0.0.9']
async def async_setup(hass, config):
+1 -1
View File
@@ -3,7 +3,7 @@
"name": "Sonos",
"documentation": "https://www.home-assistant.io/components/sonos",
"requirements": [
"pysonos==0.0.8"
"pysonos==0.0.9"
],
"dependencies": [],
"codeowners": [
+1 -12
View File
@@ -454,18 +454,7 @@ class SonosEntity(MediaPlayerDevice):
def _set_favorites(self):
"""Set available favorites."""
# SoCo 0.16 raises a generic Exception on invalid xml in favorites.
# Filter those out now so our list is safe to use.
try:
self._favorites = []
for fav in self.soco.music_library.get_sonos_favorites():
try:
if fav.reference.get_uri():
self._favorites.append(fav)
except Exception: # pylint: disable=broad-except
_LOGGER.debug("Ignoring invalid favorite '%s'", fav.title)
except Exception: # pylint: disable=broad-except
_LOGGER.debug("Ignoring invalid favorite list")
self._favorites = self.soco.music_library.get_sonos_favorites()
def _radio_artwork(self, url):
"""Return the private URL with artwork for a radio stream."""
+1 -1
View File
@@ -1270,7 +1270,7 @@ pysmartthings==0.6.7
pysnmp==4.4.8
# homeassistant.components.sonos
pysonos==0.0.8
pysonos==0.0.9
# homeassistant.components.spc
pyspcwebgw==0.4.0
+1 -1
View File
@@ -239,7 +239,7 @@ pysmartapp==0.3.2
pysmartthings==0.6.7
# homeassistant.components.sonos
pysonos==0.0.8
pysonos==0.0.9
# homeassistant.components.spc
pyspcwebgw==0.4.0