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.
Roles: list[bosesoundtouchapi.models.grouprole.GroupRole]
The list of GroupRole
objects that are (or will be) members of this Group.
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.