From 941e1e5ece8eb6540d9aaaa9956a0c886ebb71db Mon Sep 17 00:00:00 2001 From: bruce Date: Mon, 4 Nov 2024 15:03:56 +0800 Subject: [PATCH] docs: Add onChangeThreshold in Device AutoEvent The onChange flag in Device AutoEvent can prevent any non changed values sent out. The onChangeThreshold could provide the advanced feature, and the default value is 0, any changed value that exceeds (>) bounds shall be published. Signed-off-by: bruce --- openapi/core-metadata.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openapi/core-metadata.yaml b/openapi/core-metadata.yaml index 99d50c1dc3..721bd46a82 100644 --- a/openapi/core-metadata.yaml +++ b/openapi/core-metadata.yaml @@ -57,6 +57,9 @@ components: onChange: type: boolean description: OnChange indicates whether the device service will generate an event only, if the reading value is different from the previous one. If true, only generate events when readings change + onChangeThreshold: + type: number + description: OnChangeThreshold indicates any changed value that exceeds the threshold shall be generated new event if `onChange` is true, this feature only applies to the numeric reading. Available value types are `Uint8`, `Uint16`, `Uint32`, `Uint64`, `Int8`, `Int16`, `Int32`, `Int64`, `Float32`, `Float64`. The default value is 0. sourceName: type: string description: SourceName indicates the name of the resource or device command in the device profile which describes the event to generate @@ -1315,6 +1318,7 @@ components: autoEvents: - interval: 300ms onChange: true + onChangeThreshold: 0.01 sourceName: CurrentHumidity protocols: modbus-tcp: @@ -1348,6 +1352,7 @@ components: autoEvents: - interval: "100ms" onChange: true + onChangeThreshold: 0.01 sourceName: "CurrentHumidity" - apiVersion: v3 device: