mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Improve handling of offline Sonos devices (#14479)
This commit is contained in:
parent
852ce9f990
commit
6ba49e12a2
@ -682,11 +682,15 @@ class SonosDevice(MediaPlayerDevice):
|
|||||||
if group:
|
if group:
|
||||||
# New group information is pushed
|
# New group information is pushed
|
||||||
coordinator_uid, *slave_uids = group.split(',')
|
coordinator_uid, *slave_uids = group.split(',')
|
||||||
else:
|
elif self.soco.group:
|
||||||
# Use SoCo cache for existing topology
|
# Use SoCo cache for existing topology
|
||||||
coordinator_uid = self.soco.group.coordinator.uid
|
coordinator_uid = self.soco.group.coordinator.uid
|
||||||
slave_uids = [p.uid for p in self.soco.group.members
|
slave_uids = [p.uid for p in self.soco.group.members
|
||||||
if p.uid != coordinator_uid]
|
if p.uid != coordinator_uid]
|
||||||
|
else:
|
||||||
|
# Not yet in the cache, this can happen when a speaker boots
|
||||||
|
coordinator_uid = self.unique_id
|
||||||
|
slave_uids = []
|
||||||
|
|
||||||
if self.unique_id == coordinator_uid:
|
if self.unique_id == coordinator_uid:
|
||||||
sonos_group = []
|
sonos_group = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user