bosesoundtouchapi.models.contentitem

SoundTouch device ContentItem configuration object.

This class contains the attributes and sub-items that represent the content item (e.g. media source) configuration of the device.

Instances of this class can be used to switch the input source of media.

ContentItem( source: bosesoundtouchapi.soundtouchsources.SoundTouchSources = 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:
  • source (SoundTouchSources|str): source input.
  • typeValue (str): type of item.
  • location (str): a direct link to the media (if present).
  • sourceAccount (str): source account this content item is played with.
  • isPresetable (bool): true if this item can be saved as a Preset; otherwise, false.
  • name (str): item name (if present).
  • containerArt (str) a url link to the container art (if present).
  • root (Element): xmltree Element item to load arguments from.
    If specified, then other passed arguments are ignored.
ContainerArt: str

Item's container art url.

IsNavigate: bool

Returns True if the content item is part of a navigate result; otherwise, False.

IsPresetable: bool

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

Location: str

If present, a direct url link to the media.

Name: str

Item's name.

Offset: int

If present, the offset of the currently playing content.

Source: str

The type or name of the service that is currently playing or to be played.

SourceAccount: str

The account associated with the Source.

TypeValue: str

Specifies the type of this item.

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.