bosesoundtouchapi.models.presetlist

@export
class PresetList:

SoundTouch device PresetList configuration object.

This class contains the attributes and sub-items that represent the preset configuration of the device.

PresetList(root: xml.etree.ElementTree.Element = None)

Initializes a new instance of the class.

Arguments:
  • root (Element): xmltree Element item to load arguments from.
    If specified, then other passed arguments are ignored.
LastUpdatedOn: int

Date and time (in epoch format) of when the preset list was last updated.

This is a helper property, and is not part of the SoundTouch WebServices API implementation.

The list of Preset items.

def ToDictionary(self, encoding: str = 'utf-8', includeEmptyPresets: bool = False) -> dict:

Returns a dictionary representation of the class.

Arguments:
  • encoding (str): encode type (e.g. 'utf-8', 'unicode', etc).
    Default is 'utf-8'.
  • includeEmptyPresets (bool): True if the method should return all 6 preset slots, including empty ones; otherwise, False (default) to return only presets with content items.
def ToElement( self, isRequestBody: bool = False, includeEmptyPresets: bool = False) -> xml.etree.ElementTree.Element:

Returns an xmltree Element node representation of the class.

Arguments:
  • isRequestBody (bool): True if the method should only return attributes needed for a POST request body; otherwise, False to return all attributes.
  • includeEmptyPresets (bool): True if the method should return all 6 preset slots, including empty ones; otherwise, False (default) to return only presets with content items.
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 ToXmlString(self, encoding: str = 'utf-8', includeEmptyPresets: bool = False) -> str:

Returns an xml string representation of the class.

Arguments:
  • encoding (str): encode type (e.g. 'utf-8', 'unicode', etc).
    Default is 'utf-8'.
  • includeEmptyPresets (bool): True if the method should return all 6 preset slots, including empty ones; otherwise, False (default) to return only presets with content items.