bosesoundtouchapi.models.sourceitem

@export
class SourceItem:

SoundTouch device SourceItem configuration object.

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

SourceItem(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.
FriendlyName: str

The friendly name of the source (e.g. "My Media Player", "SpotifyConnectUserName", etc).

IsLocal: bool

True if a local source (e.g. "AUX", "BLUETOOTH", "QPLAY", etc); otherwise, False.

IsMultiroomAllowed: bool

True if the source can be rebroadcast in a multi-room zone; otherwise, False.

Source: str

The source of media content (e.g. "TUNEIN", "AIRPLAY", "UPNP", etc).

SourceAccount: str

The account associated with the Source.

SourceTitle: str

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

Status: str

Indicates whether the source is available or not, and its current status.

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.