Package org.openhab.core.thing.firmware
Class FirmwareUpdateProgressInfo
java.lang.Object
org.openhab.core.thing.firmware.FirmwareUpdateProgressInfo
The
FirmwareUpdateProgressInfo
represents the progress indicator for a firmware update.- Author:
- Thomas Höfer - Initial contribution, Christoph Knauf - Added progress and pending, Dimitar Ivanov - Consolidated all the needed information for firmware status events
-
Method Summary
Modifier and TypeMethodDescriptionstatic FirmwareUpdateProgressInfo
createFirmwareUpdateProgressInfo
(ThingUID thingUID, String firmwareVersion, ProgressStep progressStep, Collection<ProgressStep> sequence, boolean pending, int progress) Creates a newFirmwareUpdateProgressInfo
.static FirmwareUpdateProgressInfo
createFirmwareUpdateProgressInfo
(ThingUID thingUID, ThingTypeUID thingTypeUID, String firmwareVersion, ProgressStep progressStep, Collection<ProgressStep> sequence, boolean pending) Creates a newFirmwareUpdateProgressInfo
.boolean
Returns the firmware version of the firmware that is updated.@Nullable Integer
Returns the percentage progress of the firmware update.Returns the current progress step.Returns the sequence of the firmware update process.Returns the thing UID.int
hashCode()
boolean
Returns true if the firmware update is pending, false otherwisetoString()
-
Method Details
-
createFirmwareUpdateProgressInfo
public static FirmwareUpdateProgressInfo createFirmwareUpdateProgressInfo(ThingUID thingUID, String firmwareVersion, ProgressStep progressStep, Collection<ProgressStep> sequence, boolean pending, int progress) Creates a newFirmwareUpdateProgressInfo
.- Parameters:
thingUID
- the thing UID of the thing that is updated (must not be null)firmwareVersion
- the version of the firmware that is updated (must not be null)progressStep
- the current progress step (must not be null)sequence
- the collection of progress steps describing the sequence of the firmware update process (must not be null)pending
- the flag indicating if the update is pendingprogress
- the progress of the update in percent- Returns:
- FirmwareUpdateProgressInfo object (not null)
- Throws:
IllegalArgumentException
- if sequence is null or empty or progress is not between 0 and 100
-
createFirmwareUpdateProgressInfo
public static FirmwareUpdateProgressInfo createFirmwareUpdateProgressInfo(ThingUID thingUID, ThingTypeUID thingTypeUID, String firmwareVersion, ProgressStep progressStep, Collection<ProgressStep> sequence, boolean pending) Creates a newFirmwareUpdateProgressInfo
.- Parameters:
thingUID
- the thing UID of the thing that is updated (must not be null)firmwareVersion
- the version of the firmware that is updated (must not be null)progressStep
- the current progress step (must not be null)sequence
- the collection of progress steps describing the sequence of the firmware update process (must not be null)pending
- the flag indicating if the update is pending- Returns:
- FirmwareUpdateProgressInfo object (not null)
- Throws:
IllegalArgumentException
- if sequence is null or empty
-
getFirmwareVersion
Returns the firmware version of the firmware that is updated.- Returns:
- the firmware version of the firmware that is updated (not null)
-
getProgressStep
Returns the current progress step.- Returns:
- the current progress step (not null)
-
getSequence
Returns the sequence of the firmware update process.- Returns:
- the sequence (not null)
-
isPending
public boolean isPending()Returns true if the firmware update is pending, false otherwise- Returns:
- true if pending, false otherwise
-
getProgress
Returns the percentage progress of the firmware update.- Returns:
- the progress between 0 and 100 or null if no progress was set
-
getThingUID
Returns the thing UID.- Returns:
- the thing UID
-
hashCode
public int hashCode() -
equals
-
toString
-