bosesoundtouchapi.models.preset

SoundTouch device Preset configuration object.

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

Preset( presetId: int = None, createdOn: int = None, updatedOn: int = None, source: str = None, typeValue: str = None, location: str = None, sourceAccount: str = None, isPresetable: bool = None, name: str = None, containerArt: str = None, root: xml.etree.ElementTree.Element = None)

Initializes a new instance of the class.

Arguments:
  • presetId (int): Preset identifier; valid values are 1 thru 6.
  • createdOn (int): Date time (in epoch format) the preset was created; the current epoch time is used if the value is zero or None.
  • updatedOn (int): Date time (in epoch format) the preset was last updated; the current epoch time is used if the value is zero or None.
  • source (str): ContentItem node source value.
  • typeValue (str): ContentItem node type value.
  • location (str): ContentItem node location value.
  • sourceAccount (str): ContentItem node sourceAccount value.
  • isPresetable (bool): ContentItem node isPresetable value.
  • name (str): ContentItem node itemName value.
  • containerArt (str) ContentItem node containerArt value.
  • root (Element): xmltree Element item to load arguments from.
    If specified, then other passed arguments are ignored.

ContentItem value.

ContainerArt: str

Content item's container art url.

CreatedOn: int

Date and time (in epoch format) of when the preset was created.

It seems that on some devices (ST-10) the SoundTouch WebServices API only returns this attribute for the LAST preset that was stored; the value will not be present for any other presets. Other devices (ST-300) return this attribute on all items.

IsPresetable: str

Returns True if the content item can be saved as a Preset; otherwise, False.

Location: str

If present, the content item's direct link to the media.

Name: str

Content item's name.

PresetId: int

Preset identifier (1 - 6).

Source: str

Content item source type.

This value is defined at bosesoundtouchapi.soundtouchsources.SoundTouchSources.

SourceAccount: str

The account associated with the Source.

SourceTitle: str

The source title of media content (e.g. "Tunein", "Airplay", "NAS Music Server", etc).

This property is not part of the returned xml of the configuration, but is set after a call to `SoundTouchClient.GetPresetList(resolveSourceTitles=True)' so that source titles can be displayed by user-interfaces.

TypeValue: str

Specifies the type of the content item.

UpdatedOn: int

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

It seems that on some devices (ST-10) the SoundTouch WebServices API only returns this attribute for the LAST preset that was stored; the value will not be present for any other presets. Other devices (ST-300) return this attribute on all items.

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

Returns a dictionary representation of the class.

Arguments:
  • encoding (str): encode type (e.g. 'utf-8', 'unicode', etc).
    Default is 'utf-8'.
def ToElement(self, isRequestBody: bool = False) -> xml.etree.ElementTree.Element:

Overridden.
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) -> str:

Returns a displayable string representation of the class.

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'.