bosesoundtouchapi.models.group

SoundTouch device Group configuration object.

This class contains the attributes and sub-items that represent a group (stereo pair) configuration of the device.

Group( groupId: int = None, name: str = None, masterDeviceId: str = None, senderIpAddress: str = None, roles: list = None, root: xml.etree.ElementTree.Element = None)

Initializes a new instance of the class.

Arguments:
  • groupId (int): Unique identifier of the group.
  • name (str): User-friendly name of the Group.
  • masterDeviceId (str): Unique identifier of the master device in the group.
  • senderIPAddress (str): Sender device IPV4 address.
  • roles (list): List of GroupRole objects that are under the control of this Group.
  • root (Element): xmltree Element item to load arguments from.
    If specified, then other passed arguments are ignored.
Raises:
  • SoundTouchWarning: If any Group member specified by the members argument is not a GroupRole object, or if a device id was not supplied for each member.
GroupId: int

Unique identifier of the group.

MasterDeviceId: str

Unique identifier of the master device in the group.

Name: str

User-friendly name of the Group.

The list of GroupRole objects that are (or will be) members of this Group.

SenderIpAddress: str

Sender device IPV4 address.

State of the stereo pair group (e.g. "").

def AddRole(self, role: bosesoundtouchapi.models.grouprole.GroupRole, logsi=None):

Add a new role to the list of roles for this Group.

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

The master SoundTouch device cannot find roles without their device id. This method will validate each role 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 ToStringRoleSummary(self) -> str:

Returns a displayable string representation of the Roles list.