bosesoundtouchapi.models.zone

@export
class Zone:

SoundTouch device Zone configuration object.

This class contains the attributes and sub-items that represent a multiroom zone configuration of the device.

Zone( masterDeviceId: str = None, masterIpAddress: str = None, isZoneMaster: bool = None, members: list = None, root: xml.etree.ElementTree.Element = None)

Initializes a new instance of the class.

Arguments:
  • masterDeviceId (str): Master device identifier for this zone.
  • masterIpAddress (str): Master device ipv4 address.
  • isZoneMaster (bool): True if this zone object is a zone master; otherwise, False.
  • members (list): List of ZoneMember objects that are under the control of this zone.
  • root (Element): xmltree Element item to load arguments from.
    If specified, then other passed arguments are ignored.
Raises:
  • SoundTouchWarning: If any zone member specified by the members argument is not a ZoneMember object, or if a device id was not supplied for each member.
IsZoneMaster: bool

Returns true if this zone object is a zone master; otherwise, false.

MasterDeviceId: str

Master device identifier for this zone.

If a device is the master, the first ZoneMember object will describe itself.
If a device is a group member, the master will not be described in a member.
You can determine if a device is the master or not by comparing its MAC Address to master.

MasterIpAddress: str

Master device IPV4 address.

The list of ZoneMember objects that are (or will be) members of this Zone.

def AddMember( self, member: bosesoundtouchapi.models.zonemember.ZoneMember, logsi=None):

Add a new member to the list of members for this zone.

Arguments:
  • member: The ZoneMember object to append.
  • logsi: A SmartInspect logging session, used to log exception messages.
Raises:
  • SoundTouchError: Member to be added is not a ZoneMember object. Member to be added did not specify a DeviceId. Member DeviceId to be added or removed cannot be the master DeviceId.

The master SoundTouch device cannot find members without their device id. This method will validate each member in the list to ensure that a device id was supplied.

def ToElement(self, isRequestBody: bool = False) -> xml.etree.ElementTree.Element:

Returns an xmltree Element node representation of the class.

Arguments:
  • isRequestBody (bool): True if the element should only return attributes needed for a POST request body; otherwise, False to return all attributes.
def ToString(self, includeItems: bool = False) -> str:

Returns a displayable string representation of the class.

Arguments:
  • includeItems (bool): True to include all items in the list; otherwise False to only include the base list.
def ToStringMemberSummary(self) -> str:

Returns a displayable string representation of the Members list.

def ToXmlString(self, encoding: str = 'utf-8') -> str:

Returns an xml string representation of the class.

Arguments:
  • encoding (str): encode type (e.g. 'utf-8', 'unicode', etc).
    Default is 'utf-8'.