STU Firmware¶
The stu module contains methods and classes related to the update process. Classes defined here are made to store data.
Module Constants¶
- firmware.BOSE_ST_INDEX_URL = 'https://downloads.bose.com/updates/soundtouch'¶
Module Interfaces¶
- boseapi.firmware.load_index(root: Element) list¶
Loads an XML-Element into a list of Firmware objects.
This method can be called after fetching the index.xml file for a firmware release.
- Parameters:
root (xmltree.Element) – The xml root-element for the index file.
- Returns:
A list of parsed firmware releases.
- Return type:
list
Classes¶
Firmware¶
- class boseapi.firmware.Firmware(device_id: int = 0, product_name: Optional[str] = None, revision: Optional[str] = None, release: Optional[Release] = None, protocols: Optional[list] = None)¶
A class by bose that targets a specific 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.
- Attributes:
- device_id: str
A bose-specific device id for this hardware object.
- product_name: str
Specifying the product name for the linked firmware.
- revision: str
The revision number of the current release.
- release: BoseRelease
The linked firmware release.
- protocols: list[str]
If there are specific platform targets, some protocols are added to the
hardware object.
- loadxml(element: Element) Firmware¶
Reads the given XML-Element and loads information into an Firmware object.
This function can be called outside this class.
- Parameters:
element (xmltree.Element) – The root element
- Raises:
ValueError – if the element is null
- Returns:
the parsed firmware object
- Return type:
Release¶
- class boseapi.firmware.Release(revision: Optional[str] = None, host: Optional[str] = None, uri: Optional[str] = None, usb_uri: Optional[str] = None, image: Optional[dict] = None, notes_url: Optional[str] = None, features: Optional[list] = None)¶
A release class by bose targets a specific 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.
- Attributes:
- revision: str
The revision number of the current release.
- host: str
The hostname of the update provider.
- uri: str
The uri part of the full url linked to the downloadable update file.
- usb_uri: str
Another uri which was not usable in any context.
- image: dict[str, str]
The main property storing data related to the firmware image.
- notes_url: str
If the update file contains some release notes, the url is given within this property.
- features: list[dict[str, str]]
If there are some features within the release, they are added to this list as a dict.
Product¶
- class boseapi.firmware.Product(product_id: int = 0, index_url: Optional[str] = None, device_class: Optional[str] = None)¶
A class storing the product id and the linked URL where the firmware can be downloaded.
- Attributes:
- product_id: int
The product id given by BOSE
- index_url:
Specifies where the index.xml file is located. Use the XML-Document stored at this link as the parameter in load_index().
- device_class:
Some products have a special device_class added to their entry. (Usage unknown)
- loadxml(element: Element) Product¶
Reads the given XML-Element and loads information into an Product object.
This function can be called outside this class.
- Parameters:
element (xmltree.Element) – The root element.
- Raises:
ValueError – if the given element is null
- Returns:
An object containing all relevant information about a software release.
- Return type: