Add missing etag updates
@@ -3179,9 +3179,9 @@ void DeRestPluginPrivate::checkSensorStateTimerFired()
DBG_Printf(DBG_INFO, "sensor %s (%s): disable presence\n", qPrintable(sensor->id()), qPrintable(sensor->modelId()));
item->setValue(false);
sensor->updateStateTimestamp();
- Event e(RSensors, RStatePresence, sensor->id(), item);
- enqueueEvent(e);
+ enqueueEvent(Event(RSensors, RStatePresence, sensor->id(), item));
enqueueEvent(Event(RSensors, RStateLastUpdated, sensor->id()));
+ updateSensorEtag(sensor);
for (quint16 clusterId : sensor->fingerPrint().inClusters)
{
if (sensor->modelId().startsWith(QLatin1String("TRADFRI")))
@@ -3206,9 +3206,9 @@ void DeRestPluginPrivate::checkSensorStateTimerFired()
item->setValue(S_BUTTON_1 + S_BUTTON_ACTION_HOLD);
DBG_Printf(DBG_INFO, "[INFO] - Button %u Hold %s\n", item->toNumber(), qPrintable(sensor->modelId()));
sensor->updateStateTimestamp();
- Event e(RSensors, RStateButtonEvent, sensor->id(), item);
- enqueueEvent(e);
+ enqueueEvent(Event(RSensors, RStateButtonEvent, sensor->id(), item));
enqueueEvent(Event(RSensors, RStateLastUpdated, sensor->id()));
+ updateSensorEtag(sensor);
}
}
else if (sensor->modelId() == QLatin1String("FOHSWITCH"))
@@ -3224,9 +3224,9 @@ void DeRestPluginPrivate::checkSensorStateTimerFired()
item->setValue(btn + S_BUTTON_ACTION_HOLD);
DBG_Printf(DBG_INFO, "FoH switch button %d Hold %s\n", item->toNumber(), qPrintable(sensor->modelId()));
sensor->updateStateTimestamp();
- Event e(RSensors, RStateButtonEvent, sensor->id(), item);
- enqueueEvent(e);
+ enqueueEvent(Event(RSensors, RStateButtonEvent, sensor->id(), item));
enqueueEvent(Event(RSensors, RStateLastUpdated, sensor->id()));
+ updateSensorEtag(sensor);
}
}
else if (!item && sensor->modelId().startsWith(QLatin1String("lumi.vibration")) && sensor->type() == QLatin1String("ZHAVibration"))
@@ -3239,6 +3239,7 @@ void DeRestPluginPrivate::checkSensorStateTimerFired()
sensor->updateStateTimestamp();
enqueueEvent(Event(RSensors, RStateVibration, sensor->id(), item));
enqueueEvent(Event(RSensors, RStateLastUpdated, sensor->id()));
+ updateSensorEtag(sensor);
}
}
