bosesoundtouchapi.firmware.soundtouchfirmware
The firmware
namespace contains classes related to the Bose SoundTouch
Firmware update process.
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")
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.
If there are specific platform targets, some protocols are added to the hardware object.
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 theBOSE_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.
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.
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.