File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,7 @@ def __init__(self, ip_address):
232
232
self ._all_zones = set ()
233
233
self ._groups = set ()
234
234
self ._is_bridge = None
235
+ self ._is_coordinator = False
235
236
self ._player_name = None
236
237
self ._uid = None
237
238
self ._visible_zones = set ()
@@ -314,6 +315,20 @@ def is_bridge(self):
314
315
self ._parse_zone_group_state ()
315
316
return self ._is_bridge
316
317
318
+ @property
319
+ def is_coordinator (self ):
320
+ """ Return True if this zone is a group coordinator, otherwise False.
321
+
322
+ return True or False
323
+
324
+ """
325
+ # We could do this:
326
+ # invisible = self.deviceProperties.GetInvisible()['CurrentInvisible']
327
+ # but it is better to do it in the following way, which uses the
328
+ # zone group topology, to capitalise on any caching.
329
+ self ._parse_zone_group_state ()
330
+ return self ._is_coordinator
331
+
317
332
@property
318
333
def play_mode (self ):
319
334
""" The queue's play mode. Case-insensitive options are::
@@ -721,6 +736,9 @@ def _parse_zone_group_state(self):
721
736
# the coordinator
722
737
if zone ._uid == coordinator_uid :
723
738
group_coordinator = zone
739
+ zone ._is_coordinator = True
740
+ else :
741
+ zone ._is_coordinator = False
724
742
zone ._player_name = member_attribs ['ZoneName' ]
725
743
# uid and is_bridge do not change, but it does no real harm to
726
744
# set/reset them here, just in case the zone has not been seen
You can’t perform that action at this time.
0 commit comments