mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Fix Sonos handling of unsupported favorites (#22906)
This commit is contained in:
parent
55c8417ec0
commit
d577955d1e
@ -4,7 +4,7 @@ from homeassistant.helpers import config_entry_flow
|
|||||||
|
|
||||||
|
|
||||||
DOMAIN = 'sonos'
|
DOMAIN = 'sonos'
|
||||||
REQUIREMENTS = ['pysonos==0.0.8']
|
REQUIREMENTS = ['pysonos==0.0.9']
|
||||||
|
|
||||||
|
|
||||||
async def async_setup(hass, config):
|
async def async_setup(hass, config):
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Sonos",
|
"name": "Sonos",
|
||||||
"documentation": "https://www.home-assistant.io/components/sonos",
|
"documentation": "https://www.home-assistant.io/components/sonos",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"pysonos==0.0.8"
|
"pysonos==0.0.9"
|
||||||
],
|
],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"codeowners": [
|
"codeowners": [
|
||||||
|
@ -454,18 +454,7 @@ class SonosEntity(MediaPlayerDevice):
|
|||||||
|
|
||||||
def _set_favorites(self):
|
def _set_favorites(self):
|
||||||
"""Set available favorites."""
|
"""Set available favorites."""
|
||||||
# SoCo 0.16 raises a generic Exception on invalid xml in favorites.
|
self._favorites = self.soco.music_library.get_sonos_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")
|
|
||||||
|
|
||||||
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."""
|
||||||
|
@ -1270,7 +1270,7 @@ pysmartthings==0.6.7
|
|||||||
pysnmp==4.4.8
|
pysnmp==4.4.8
|
||||||
|
|
||||||
# homeassistant.components.sonos
|
# homeassistant.components.sonos
|
||||||
pysonos==0.0.8
|
pysonos==0.0.9
|
||||||
|
|
||||||
# homeassistant.components.spc
|
# homeassistant.components.spc
|
||||||
pyspcwebgw==0.4.0
|
pyspcwebgw==0.4.0
|
||||||
|
@ -239,7 +239,7 @@ pysmartapp==0.3.2
|
|||||||
pysmartthings==0.6.7
|
pysmartthings==0.6.7
|
||||||
|
|
||||||
# homeassistant.components.sonos
|
# homeassistant.components.sonos
|
||||||
pysonos==0.0.8
|
pysonos==0.0.9
|
||||||
|
|
||||||
# homeassistant.components.spc
|
# homeassistant.components.spc
|
||||||
pyspcwebgw==0.4.0
|
pyspcwebgw==0.4.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user