Skip to content

Commit

Permalink
Add seqnum attribute to zones
Browse files Browse the repository at this point in the history
  • Loading branch information
jjlawren committed Aug 5, 2021
1 parent 5602d28 commit 9273280
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions soco/core.py
Expand Up @@ -293,6 +293,7 @@ def __init__(self, ip_address):

# Some private attributes
self._all_zones = set()
self._boot_seqnum = None
self._groups = set()
self._is_bridge = None
self._is_coordinator = False
Expand All @@ -312,6 +313,12 @@ def __str__(self):
def __repr__(self):
return '{}("{}")'.format(self.__class__.__name__, self.ip_address)

@property
def boot_seqnum(self):
"""int: The boot sequence number."""
self._parse_zone_group_state()
return int(self._boot_seqnum)

@property
def player_name(self):
"""str: The speaker's name."""
Expand Down Expand Up @@ -1186,6 +1193,7 @@ def parse_zone_group_member(member_element):
# the zone is as yet unseen.
zone._uid = member_attribs["UUID"]
zone._player_name = member_attribs["ZoneName"]
zone._boot_seqnum = member_attribs["BootSeq"]
# add the zone to the set of all members, and to the set
# of visible members if appropriate
is_visible = member_attribs.get("Invisible") != "1"
Expand Down

0 comments on commit 9273280

Please sign in to comment.