From c628c2cef28a99d711b768837f144e160311f2b0 Mon Sep 17 00:00:00 2001 From: Anders Melchiorsen Date: Sat, 4 Apr 2020 07:41:39 +0200 Subject: [PATCH] Identify more Sonos radio stations with poor titles (#33609) --- homeassistant/components/sonos/media_player.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/sonos/media_player.py b/homeassistant/components/sonos/media_player.py index d54e6dd968f..d76af1dc704 100644 --- a/homeassistant/components/sonos/media_player.py +++ b/homeassistant/components/sonos/media_player.py @@ -614,11 +614,11 @@ class SonosEntity(MediaPlayerDevice): except (TypeError, KeyError, AttributeError): pass - # Radios without tagging can have the radio URI as title. Non-playing - # radios will not have a current title. In these cases we try to use - # the radio name instead. + # Radios without tagging can have part of the radio URI as title. + # Non-playing radios will not have a current title. In these cases we + # try to use the radio name instead. try: - if self.soco.is_radio_uri(self._media_title) or self.state != STATE_PLAYING: + if self._media_title in self._uri or self.state != STATE_PLAYING: self._media_title = variables["enqueued_transport_uri_meta_data"].title except (TypeError, KeyError, AttributeError): pass