aqhome-data: update timestamp in value.

This commit is contained in:
Martin Preuss
2026-08-31 11:58:18 +02:00
parent dce410f6bd
commit 222dc043bf
3 changed files with 7 additions and 1 deletions

View File

@@ -101,6 +101,8 @@ void AqHomeDataServer_HandleSetData(AQH_OBJECT *o, AQH_OBJECT *epSrc, const AQH_
AqHomeDataServer_AddRequestToTree(o, rq);
_storeDatapoint(xo, systemValue, valueData);
AQH_Value_SetTimestampLastChange(systemValue, (uint64_t) time(NULL));
AQH_Storage_AddRuntimeFlags(xo->storage, AQH_STORAGE_RTFLAGS_MODIFIED);
}
else {
DBG_ERROR(NULL, "Driver \"%s\" not available", driverName);

View File

@@ -76,7 +76,10 @@ void AqHomeDataServer_HandleUpdateData(AQH_OBJECT *o, AQH_OBJECT *ep, const AQH_
value=AqHomeDataServer_GetOrCreateValueForDriverWithTemplate(o, ep, recvdValue);
if (value) {
if (AQH_Endpoint_GetPermissions(ep) & AQH_ENDPOINT_PERMS_ADDDATA) {
resultCode=_storeDataPoints(xo, value, dataPoints, numberOfPoints);
AQH_Value_SetTimestampLastChange(value, (uint64_t) time(NULL));
AQH_Storage_AddRuntimeFlags(xo->storage, AQH_STORAGE_RTFLAGS_MODIFIED);
resultCode=_storeDataPoints(xo, value, dataPoints, numberOfPoints);
if (resultCode==AQH_MSGDATA_RESULT_SUCCESS)
_sendDataChangedMsgToAllClients(xo, ep, value, dataPoints, numberOfPoints);
}

View File

@@ -696,6 +696,7 @@ void _createValue(AQHOME_SERVER *xo, AQH_OBJECT *epDriver,
AQH_Value_SetValueType(v, AQH_Value_GetValueType(valueTemplate));
AQH_Value_SetModality(v, AQH_Value_GetModality(valueTemplate));
AQH_Value_SetTimestampCreation(v, (uint64_t) time(NULL));
AQH_Value_SetTimestampLastChange(v, (uint64_t) time(NULL));
if (device) {
AQH_Value_SetDeviceNameForSystem(v, AQH_Device_GetNameForSystem(device));
AQH_Value_SetDeviceName(v, AQH_Device_GetName(device));