Fix Sonos speaker lookup for Plex (#37942)

This commit is contained in:
jjlawren authored and Paulus Schoutsen committed 2020-07-18 23:37:48 +00:00
1 parent 757d05a74e
commit a3429848a2
4 files changed
+19 -17

No files matched your search

+3 -3
View File
@@ -215,7 +215,7 @@ def play_on_sonos(hass, service_call):
sonos = hass.components.sonos
try:
sonos_id = sonos.get_coordinator_id(entity_id)
sonos_name = sonos.get_coordinator_name(entity_id)
except HomeAssistantError as err:
_LOGGER.error("Cannot get Sonos device: %s", err)
return
@@ -239,10 +239,10 @@ def play_on_sonos(hass, service_call):
else:
plex_server = next(iter(plex_servers))
sonos_speaker = plex_server.account.sonos_speaker_by_id(sonos_id)
sonos_speaker = plex_server.account.sonos_speaker(sonos_name)
if sonos_speaker is None:
_LOGGER.error(
"Sonos speaker '%s' could not be found on this Plex account", sonos_id
"Sonos speaker '%s' could not be found on this Plex account", sonos_name
)
return