mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Ignore unsupported Sonos favorite lists (#14665)
This commit is contained in:
parent
8c7f0669c6
commit
f2a2f2cca5
@ -427,15 +427,18 @@ class SonosDevice(MediaPlayerDevice):
|
|||||||
self.update_volume()
|
self.update_volume()
|
||||||
|
|
||||||
self._favorites = []
|
self._favorites = []
|
||||||
for fav in self.soco.music_library.get_sonos_favorites():
|
# SoCo 0.14 raises a generic Exception on invalid xml in favorites.
|
||||||
# SoCo 0.14 raises a generic Exception on invalid xml in favorites.
|
# Filter those out now so our list is safe to use.
|
||||||
# Filter those out now so our list is safe to use.
|
# pylint: disable=broad-except
|
||||||
try:
|
try:
|
||||||
if fav.reference.get_uri():
|
for fav in self.soco.music_library.get_sonos_favorites():
|
||||||
self._favorites.append(fav)
|
try:
|
||||||
# pylint: disable=broad-except
|
if fav.reference.get_uri():
|
||||||
except Exception:
|
self._favorites.append(fav)
|
||||||
_LOGGER.debug("Ignoring invalid favorite '%s'", fav.title)
|
except Exception:
|
||||||
|
_LOGGER.debug("Ignoring invalid favorite '%s'", fav.title)
|
||||||
|
except Exception:
|
||||||
|
_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."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user