mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[freeboxos] Fix triggering of event firmware_updated (#17161)
Also update the firmware property when the player is reachable for the first time. Do not trigger the event firmware_updated when just first setting the firmware property. Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
parent
20251feb09
commit
f42fd6260a
@ -36,11 +36,16 @@ public interface FreeDeviceIntf extends ApiConsumerIntf {
|
||||
default long checkUptimeAndFirmware(long newUptime, long oldUptime, String firmwareVersion) {
|
||||
if (newUptime < oldUptime) {
|
||||
triggerChannel(getEventChannelUID(), "restarted");
|
||||
}
|
||||
if (oldUptime < 0 || newUptime < oldUptime) {
|
||||
Map<String, String> properties = editProperties();
|
||||
if (!firmwareVersion.equals(properties.get(Thing.PROPERTY_FIRMWARE_VERSION))) {
|
||||
String property = properties.get(Thing.PROPERTY_FIRMWARE_VERSION);
|
||||
if (!firmwareVersion.equals(property)) {
|
||||
properties.put(Thing.PROPERTY_FIRMWARE_VERSION, firmwareVersion);
|
||||
updateProperties(properties);
|
||||
triggerChannel(getEventChannelUID(), "firmware_updated");
|
||||
if (property != null) {
|
||||
triggerChannel(getEventChannelUID(), "firmware_updated");
|
||||
}
|
||||
}
|
||||
}
|
||||
return newUptime;
|
||||
|
Loading…
Reference in New Issue
Block a user