bosesoundtouchapi.soundtouchmessage

@export
class SoundTouchMessage:

A class representing an exchange object.

In order to exchange data between a client and the device, this class type is used. It stores the request text/uri and the response as an XML- Element.

SoundTouchMessage( uri: bosesoundtouchapi.uri.soundtouchuri.SoundTouchUri = None, xmlMessage: str = None, response: xml.etree.ElementTree.Element = None, requestHeaders: dict = None)

Initializes a new instance of the class.

Arguments:
  • uri (SoundTouchUri): The target uri which should be queried.
  • xmlMessage (str): If a key should be pressed or new data should be saved on the target device, an xml formatted string is needed.
  • response (xml.etree.ElementTree.Element): The response object as an XML-Element.
  • requestHeaders (dict): Request header that is to be placed into the http request headers, if the specified uri service requires it; otherwise, None.
HasRequestHeaders: bool

Returns True if request headers are present, and should be supplied as part of the http request headers; otherwise, False.

HasXmlMessage: bool

Returns True if an xml message was returned with the response; otherwise, False.

IsRequestDataEncoded: bool

Indicates if the XmlMessage property is already encoded (True) or not (False).

IsSimpleResponse: bool

Returns True if the response is a simple pass / fail response; otherwise, False if the response requires further processing.

RequestHeaders: Mapping[str, str]

Request header data that is to be sent with the http request body, if the specified uri service requires it.

Response: xml.etree.ElementTree.Element

Returns the device response as an xml.etree.ElementTree.Element object.

Uri: str

The SoundTouchUri object used to make the request.

XmlMessage: str

The returned xml formatted message string.

def ToString(self) -> str:

Returns a displayable string representation of the class.