Search in sources :

Example 1 with ThingStatusInfoChangedEvent

use of org.eclipse.smarthome.core.thing.events.ThingStatusInfoChangedEvent in project smarthome by eclipse.

the class FirmwareUpdateService method receive.

@Override
public void receive(Event event) {
    if (event instanceof ThingStatusInfoChangedEvent) {
        ThingStatusInfoChangedEvent changedEvent = (ThingStatusInfoChangedEvent) event;
        if (changedEvent.getStatusInfo().getStatus() != ThingStatus.ONLINE) {
            return;
        }
        ThingUID thingUID = changedEvent.getThingUID();
        FirmwareUpdateHandler firmwareUpdateHandler = getFirmwareUpdateHandler(thingUID);
        if (firmwareUpdateHandler != null && !firmwareStatusInfoMap.containsKey(thingUID)) {
            initializeFirmwareStatus(firmwareUpdateHandler);
        }
    }
}
Also used : ThingStatusInfoChangedEvent(org.eclipse.smarthome.core.thing.events.ThingStatusInfoChangedEvent) FirmwareUpdateHandler(org.eclipse.smarthome.core.thing.binding.firmware.FirmwareUpdateHandler) ThingUID(org.eclipse.smarthome.core.thing.ThingUID)

Aggregations

ThingUID (org.eclipse.smarthome.core.thing.ThingUID)1 FirmwareUpdateHandler (org.eclipse.smarthome.core.thing.binding.firmware.FirmwareUpdateHandler)1 ThingStatusInfoChangedEvent (org.eclipse.smarthome.core.thing.events.ThingStatusInfoChangedEvent)1