Package org.openhab.core.thing.firmware
Class FirmwareStatusInfo
java.lang.Object
org.openhab.core.thing.firmware.FirmwareStatusInfo
The
FirmwareStatusInfo represents the FirmwareStatus of a Thing. If the firmware status is
FirmwareStatus.UPDATE_EXECUTABLE then the information object will also provide the thing UID and the
version of the latest updatable firmware for the thing.- Author:
- Thomas Höfer - Initial contribution, Dimitar Ivanov - Consolidated all the needed information for firmware status events
-
Method Summary
Modifier and TypeMethodDescriptionstatic FirmwareStatusInfocreateUnknownInfo(ThingUID thingUID) Creates a newFirmwareStatusInfohavingFirmwareStatus.UNKNOWNas firmware status.static FirmwareStatusInfocreateUpdateAvailableInfo(ThingUID thingUID) Creates a newFirmwareStatusInfohavingFirmwareStatus.UPDATE_AVAILABLEas firmware status.static FirmwareStatusInfocreateUpdateExecutableInfo(ThingUID thingUID, @Nullable String firmwareVersion) Creates a newFirmwareStatusInfohavingFirmwareStatus.UPDATE_EXECUTABLEas firmware status.static FirmwareStatusInfocreateUpToDateInfo(ThingUID thingUID) Creates a newFirmwareStatusInfohavingFirmwareStatus.UP_TO_DATEas firmware status.booleanReturns the firmware status.Returns the thing UID.@Nullable StringReturns the firmware version of the latest updatable firmware for the thing.inthashCode()toString()
-
Method Details
-
createUnknownInfo
Creates a newFirmwareStatusInfohavingFirmwareStatus.UNKNOWNas firmware status.- Returns:
- the firmware status info (not null)
-
createUpToDateInfo
Creates a newFirmwareStatusInfohavingFirmwareStatus.UP_TO_DATEas firmware status.- Returns:
- the firmware status info (not null)
-
createUpdateAvailableInfo
Creates a newFirmwareStatusInfohavingFirmwareStatus.UPDATE_AVAILABLEas firmware status.- Returns:
- the firmware status info (not null)
-
createUpdateExecutableInfo
public static FirmwareStatusInfo createUpdateExecutableInfo(ThingUID thingUID, @Nullable String firmwareVersion) Creates a newFirmwareStatusInfohavingFirmwareStatus.UPDATE_EXECUTABLEas firmware status. The given firmware version represents the version of the latest updatable firmware for the thing.- Parameters:
firmwareVersion- the version of the latest updatable firmware for the thing (must not be null)- Returns:
- the firmware status info (not null)
-
getFirmwareStatus
Returns the firmware status.- Returns:
- the firmware status (not null)
-
getUpdatableFirmwareVersion
Returns the firmware version of the latest updatable firmware for the thing.- Returns:
- the firmware version (only set if firmware status is
FirmwareStatus.UPDATE_EXECUTABLE)
-
getThingUID
Returns the thing UID.- Returns:
- the thing UID of the thing, whose status is updated (not null)
-
hashCode
public int hashCode() -
equals
-
toString
-