Package org.openhab.core.thing.firmware
Interface FirmwareUpdateService
@NonNullByDefault
public interface FirmwareUpdateService
The firmware update service is registered as an OSGi service and is responsible for tracking all available
FirmwareUpdateHandler
s. It provides access to the current FirmwareStatusInfo
of a thing and is the
central instance to start a firmware update.- Author:
- Thomas Höfer - Initial contribution, Dimitar Ivanov - Extracted interface
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancelFirmwareUpdate
(ThingUID thingUID) Cancels the firmware update of the thing having the given thing UID by invoking the operationFirmwareUpdateHandler.cancel()
of the thing´s firmware update handler.@Nullable FirmwareStatusInfo
getFirmwareStatusInfo
(ThingUID thingUID) Returns theFirmwareStatusInfo
for the thing having the given thing UID.void
updateFirmware
(ThingUID thingUID, String firmwareVersion, @Nullable Locale locale) Updates the firmware of the thing having the given thing UID by invoking the operationFirmwareUpdateHandler.updateFirmware(Firmware, ProgressCallback)
of the thing´s firmware update handler.
-
Method Details
-
getFirmwareStatusInfo
Returns theFirmwareStatusInfo
for the thing having the given thing UID.- Parameters:
thingUID
- the UID of the thing (must not be null)- Returns:
- the firmware status info (is null if there is no
FirmwareUpdateHandler
for the thing available)
-
updateFirmware
Updates the firmware of the thing having the given thing UID by invoking the operationFirmwareUpdateHandler.updateFirmware(Firmware, ProgressCallback)
of the thing´s firmware update handler.This operation is a non-blocking operation by spawning a new thread around the invocation of the firmware update handler. The time out of the thread is 30 minutes.
- Parameters:
thingUID
- the thing UID (must not be null)firmwareVersion
- the version of the firmware to be updated (must not be null)locale
- the locale to be used to internationalize error messages (if null then the locale provided by theLocaleProvider
is used)- Throws:
IllegalStateException
- if- there is no firmware update handler for the thing
- the firmware update handler is not able to execute the firmware update
IllegalArgumentException
- if- the firmware cannot be found
- the firmware is not suitable for the thing
- the firmware requires another prerequisite firmware version
-
cancelFirmwareUpdate
Cancels the firmware update of the thing having the given thing UID by invoking the operationFirmwareUpdateHandler.cancel()
of the thing´s firmware update handler.- Parameters:
thingUID
- the thing UID (must not be null)
-