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).
IsMultiroomAllowed: bool
True if the source can be rebroadcast in a multi-room zone; otherwise, False.
SourceTitle: str
The source title of media content (e.g. "Tunein", "Airplay", "NAS Music Server", etc).
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.