bosesoundtouchapi.models.playinfo

SoundTouch device PlayInfo configuration object.

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

PlayInfo( url: str = None, service: str = None, message: str = None, reason: str = None, volume: int = 30, appKey: str = None, root: xml.etree.ElementTree.Element = None)

Initializes a new instance of the class.

Arguments:
  • url (str): The URL to be played.
  • service (str): The service text that will appear in the NowPlaying Artist node.
  • message (str): The message text that will appear in the NowPlaying Album node.
  • reason (str): The reason text that will appear in the NowPlaying Track node.
  • volume (int): The volume level (0-100) to set for the notification.
  • appKey (str): Bose Developer API application key.
  • root (Element): xmltree Element item to load arguments from.
    If specified, then other passed arguments are ignored.

The play_info service supports the following file formats and bit rates:

  • MP3: 8 kbit/s ~ 320 kbit/s
  • AAC: 24 kbit/s ~ 128 kbit/s
  • HE-AAC: 48 kbit/s ~ 64 kbit/s
  • WMA: 8 kbit/s ~ 329 kbit/s
  • Vorbis: 32 kbit/S ~ 500 kbit/s
  • FLAC: VBR: 0bit/s ~ 1.4 Mbit/s, up to CD quality (2 channels / 48 kHz / 16 bit)
  • ALAC: 300 kbit/s ~ 5 Mbit/s, HD (2 channels / 96 kHz / 32 bit)
AppKey: str

Bose Developer API application key.

Service: str

The service text that will appear in the NowPlaying Artist node.

Message: str

The message text that will appear in the NowPlaying Album node.

Reason: str

The reason text that will appear in the NowPlaying Track node.

Url: str

The URL to be played.

Volume: int

The volume level (0-100) to set for the notification.
Specify a value of 0 to play the notification at the current volume level.

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