bosesoundtouchapi.models.searchresult

@export
class SearchResult:

SoundTouch device SearchResult configuration object.

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

SearchResult(root: xml.etree.ElementTree.Element)

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.
Artist: str

Name of the artist (for song result), or None (if not present).

Name: str

Name of the artist (for artists result) or the track (for songs result).

Source: str

Music service source where the result was obtained from (e.g. "PANDORA", "SPOTIFY", etc).

SourceAccount: str

The account associated with the Source.

Token: str

Token value that uniquely identifies the song or artist.

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:

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.