bosesoundtouchapi.firmware.soundtouchfirmware

The firmware namespace contains classes related to the Bose SoundTouch Firmware update process.

@export
class SoundTouchFirmware:

A class that targets a specific Bose SoundTouch firmware upgrade.

The specific information can be loaded from an XML-Element (ElementTree.Element). There is a static method that implements the parsing process to save the values stored in the XML-Element.

Sample Code

# external package imports.
from xml.etree.ElementTree import Element

# our package imports.
from bosesoundtouchapi import *
from bosesoundtouchapi.firmware import *

print("** Test Starting\n")

try:

    # get SoundTouch firmware update index.xml data.
    print("\nRetrieving index.xml document from: %s" % BOSE_SOUNDTOUCH_UPDATE_INDEX_URL)
    index:Element = SoundTouchFirmware.GetIndex(BOSE_SOUNDTOUCH_UPDATE_INDEX_URL)

    # create list of SoundTouchFirmware objects from index.xml data.
    print("\nParsing index.xml document ...")
    firmwareList:list = SoundTouchFirmware.LoadIndex(index)

    # print SoundTouchFirmware object summary.
    print("\nFirmware items found:")
    for item in firmwareList:
        print(item.ToString())

except Exception as ex:

    print("** Exception: %s" % str(ex))

finally:

    print("\n** Test Completed")

SoundTouchFirmware( deviceId: int = 0, productName: str = None, supportedOs: str = None, hardwareRevision: str = None, hardwareRelease: bosesoundtouchapi.firmware.soundtouchfirmwarerelease.SoundTouchFirmwareRelease = None, protocolRevision: str = None, protocolImages: list = None)
Arguments:
  • deviceId (str): A Bose-specific device id for this hardware object.
  • productName (str): Product name for the linked firmware.
  • supportedOs (str): Supported operating system for the linked firmware.
  • hardwareRevision (str): The hardware revision number of the current release.
  • hardwareRelease (SoundTouchFirmwareRelease): The hardware firmware release details.
  • protocolRevision (str): If there are specific platform targets, a protocol revision number.
  • protocolImages (list): If there are specific platform targets, some protocol images are added to the hardware object.
DeviceId: int

A Bose-specific device id for this hardware object.

HardwareRevision: str

The hardware revision number of the current release.

The hardware firmware release details.

ProductName: str

Product name for the linked firmware.

ProtocolImages: list

If there are specific platform targets, some protocols are added to the hardware object.

ProtocolRevision: str

If there are specific platform targets, a protocol revision number.

SupportedOs: str

Supported operating system for the linked firmware.

@staticmethod
def GetIndex(url: str) -> xml.etree.ElementTree.Element:

Downloads the product index.xml file from the given url and returns an Element object with the results.

Arguments:
  • url (str): Url to query for the index.xml file.
    Refer to the BOSE_SOUNDTOUCH_UPDATE_INDEX_URL constant for more information.
Returns:

An xml.etree.ElementTree.Element object of the index file contents if downloaded successfully; otherwise, False.

Raises:
  • SoundTouchError: If the url argument is null. If the contents of the url could not be downloaded.
@staticmethod
def LoadFromXmlElement( element: xml.etree.ElementTree.Element) -> SoundTouchFirmware:

Creates a new SoundTouchFirmware instance from an xml element that contains firmware details.

Arguments:
  • element (xml.etree.ElementTree.Element): The root element
Returns:

A SoundTouchFirmware object that contains the parsed firmware details.

Raises:
  • SoundTouchError: If the element argument is null.
@staticmethod
def LoadIndex(root: xml.etree.ElementTree.Element) -> list:

Loads an XML-Element into a list of SoundTouchFirmware objects.

This method can be called after fetching the index.xml file for a firmware release.

Arguments:
  • root (xml.etree.ElementTree.Element): The xml root-element for the index file.

Returns:
A list of parsed firmware releases.

def ToString(self) -> str:

Returns a displayable string representation of the class.