From 3a5f29e822587f702fcf1a4983652b4c56b49f7b Mon Sep 17 00:00:00 2001 From: Trevor Date: Thu, 7 Dec 2023 07:11:19 -0500 Subject: [PATCH] Add initial writeback easing specification (#781) * Adding easing examples * Add gencode --- .gencode_hash.txt | 6 +- gencode/docs/config.html | 59 +++++++++++++++++++ .../java/udmi/schema/PointPointsetConfig.java | 12 +++- .../udmi/schema/config_pointset_point.py | 4 ++ schema/config_pointset_point.json | 6 ++ tests/schemas/config/easing.json | 19 ++++++ tests/schemas/config/easing.out | 0 tests/schemas/config_pointset/easing.json | 14 +++++ tests/schemas/config_pointset/easing.out | 0 9 files changed, 116 insertions(+), 4 deletions(-) create mode 100644 tests/schemas/config/easing.json create mode 100644 tests/schemas/config/easing.out create mode 100644 tests/schemas/config_pointset/easing.json create mode 100644 tests/schemas/config_pointset/easing.out diff --git a/.gencode_hash.txt b/.gencode_hash.txt index 911623dfe4..8c2504e268 100644 --- a/.gencode_hash.txt +++ b/.gencode_hash.txt @@ -1,6 +1,6 @@ b35646a2f3d7c30fd34e3ea6ab6a1070b39c469fd1de49cab1093ff32faaf06d gencode/docs/command_discovery.html cde866298a8a54168d3582b50ec93160209d07338d3d6c58d215855bc35cb158 gencode/docs/command_mapping.html -3757f7214d426fec626fe08156766f5b5ad872e65e350ee181162d5d3a7e24d6 gencode/docs/config.html +0ad0aafdfd7fa858f1fa14ff4f044f878fc2df398210d798e64cf6af98c88672 gencode/docs/config.html 4809ac52b172f1754cc311928c9b54611ec52837d7cce11ee03789c603cbc655 gencode/docs/config_mapping.html 08583688b20f892c0b453f41787ac01a46ac601663736bcd6ed6f57be0758e79 gencode/docs/configuration_endpoint.html 6cf94d6cb600c75cde32a64bd78acb3ed3b54adfad08dbf6bb159b467e8925c9 gencode/docs/configuration_execution.html @@ -88,7 +88,7 @@ b3b7ef6cae004d5fdb4052f860df0aa583df87bb798a027fc769aeaf16489789 gencode/java/u 5e1c5411fae4d7c47391ceb5d19ae864fcd484df75ac6b6db39fd2d12647dec8 gencode/java/udmi/schema/Physical_tag.java 3e331b3817cc87f2fe087aae3a1e599819ceda1ca086094d7f400f5f1c3bdbb9 gencode/java/udmi/schema/PodConfiguration.java d808259db6bbcd26ecf438844ce286d15d4750906be24588d97acfbe8a4ae315 gencode/java/udmi/schema/PointEnumerationEvent.java -eb478a6ebd66b150da8d6dc8fdf05a10d09d6d0ea1df8a0578728703718c5551 gencode/java/udmi/schema/PointPointsetConfig.java +468c2c95e9dcbaf4ff706fad7f168c14321eaa35b7fb190848ea8bfd86d981d7 gencode/java/udmi/schema/PointPointsetConfig.java 8f3fc1cdc2dcd3e524863f4675aebabc450a35f5fd1cdc3fd37289b5cab7f2ec gencode/java/udmi/schema/PointPointsetEvent.java 65337109653a93d873dae40eb517857149bae1b20c7b479f41b35c0822d94ba0 gencode/java/udmi/schema/PointPointsetModel.java a77b840d671100245c7b68ef8b0130d1ea6375c6ed8a2e145b4208b5962bbc66 gencode/java/udmi/schema/PointPointsetState.java @@ -141,7 +141,7 @@ b461bdc24310ef972faf579b5be577b5af67fb0977d6afb4c42955211b26e3d5 gencode/python ac3facbd96f7cb2f7e387e7497d6a36af379a2687329571f250c5670f9933244 gencode/python/udmi/schema/config_mapping.py 52bce04ef0d73ac1c543dfa676cc9d1d0b5ac8f2ba6dac84b5a26f927a6c2479 gencode/python/udmi/schema/config_mapping_device.py 9eab64849e04b25203d5da47856c3f8dda2b96903e4dc43ab932ee35014700bd gencode/python/udmi/schema/config_pointset.py -33ce7ee99051d56dd3c4d69edf92583d0bb7fd751417948b71292ac2285d3c19 gencode/python/udmi/schema/config_pointset_point.py +5444c5eb6971addf729566e39e7eb13dd8b78dceeeab3ef8a6ec3d2a7f5ed25c gencode/python/udmi/schema/config_pointset_point.py 7da3bdb37f338260d5f3829fa5fcbb9bbf9f146b514a68319c314a96c6b8ac12 gencode/python/udmi/schema/config_system.py cce623b34fd694880039a1c080214c33e00acaef5bc72276cf11a3bb2de40000 gencode/python/udmi/schema/config_system_testing.py 30b1809e364cb3f7070002bb4a9954b11b25543b099b4bbe450d280001e4de55 gencode/python/udmi/schema/config_udmi.py diff --git a/gencode/docs/config.html b/gencode/docs/config.html index a3f01bf35e..561b7824c6 100644 --- a/gencode/docs/config.html +++ b/gencode/docs/config.html @@ -2364,6 +2364,65 @@

+
+
+
+

+ +

+
+ +
+
+ + Type: string
+

RFC 3339 timestamp for the specified point write easing to stop

+
+ + + + + +
+
Example:
+
"2019-01-17T14:02:29.364Z"
+
+
+
+
+
+
diff --git a/gencode/java/udmi/schema/PointPointsetConfig.java b/gencode/java/udmi/schema/PointPointsetConfig.java index d555fe1b79..42a908d2b2 100644 --- a/gencode/java/udmi/schema/PointPointsetConfig.java +++ b/gencode/java/udmi/schema/PointPointsetConfig.java @@ -1,6 +1,7 @@ package udmi.schema; +import java.util.Date; import javax.annotation.processing.Generated; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -19,6 +20,7 @@ "ref", "units", "set_value", + "stop_time", "cov_increment" }) @Generated("jsonschema2pojo") @@ -45,6 +47,13 @@ public class PointPointsetConfig { @JsonProperty("set_value") @JsonPropertyDescription("Used for cloud writeback functionality, this field specifies the value for a given point in the device's current units.") public Object set_value; + /** + * RFC 3339 timestamp for the specified point write easing to stop + * + */ + @JsonProperty("stop_time") + @JsonPropertyDescription("RFC 3339 timestamp for the specified point write easing to stop") + public Date stop_time; /** * The CoV (change of value) increment, which when set, enables CoV on the point and defines the minimum change in present value of the respective point before an update is published * @@ -58,6 +67,7 @@ public int hashCode() { int result = 1; result = ((result* 31)+((this.ref == null)? 0 :this.ref.hashCode())); result = ((result* 31)+((this.units == null)? 0 :this.units.hashCode())); + result = ((result* 31)+((this.stop_time == null)? 0 :this.stop_time.hashCode())); result = ((result* 31)+((this.set_value == null)? 0 :this.set_value.hashCode())); result = ((result* 31)+((this.cov_increment == null)? 0 :this.cov_increment.hashCode())); return result; @@ -72,7 +82,7 @@ public boolean equals(Object other) { return false; } PointPointsetConfig rhs = ((PointPointsetConfig) other); - return (((((this.ref == rhs.ref)||((this.ref!= null)&&this.ref.equals(rhs.ref)))&&((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units))))&&((this.set_value == rhs.set_value)||((this.set_value!= null)&&this.set_value.equals(rhs.set_value))))&&((this.cov_increment == rhs.cov_increment)||((this.cov_increment!= null)&&this.cov_increment.equals(rhs.cov_increment)))); + return ((((((this.ref == rhs.ref)||((this.ref!= null)&&this.ref.equals(rhs.ref)))&&((this.units == rhs.units)||((this.units!= null)&&this.units.equals(rhs.units))))&&((this.stop_time == rhs.stop_time)||((this.stop_time!= null)&&this.stop_time.equals(rhs.stop_time))))&&((this.set_value == rhs.set_value)||((this.set_value!= null)&&this.set_value.equals(rhs.set_value))))&&((this.cov_increment == rhs.cov_increment)||((this.cov_increment!= null)&&this.cov_increment.equals(rhs.cov_increment)))); } } diff --git a/gencode/python/udmi/schema/config_pointset_point.py b/gencode/python/udmi/schema/config_pointset_point.py index 4f5433724b..349aaf3d29 100644 --- a/gencode/python/udmi/schema/config_pointset_point.py +++ b/gencode/python/udmi/schema/config_pointset_point.py @@ -8,6 +8,7 @@ def __init__(self): self.ref = None self.units = None self.set_value = None + self.stop_time = None self.cov_increment = None @staticmethod @@ -18,6 +19,7 @@ def from_dict(source): result.ref = source.get('ref') result.units = source.get('units') result.set_value = source.get('set_value') + result.stop_time = source.get('stop_time') result.cov_increment = source.get('cov_increment') return result @@ -45,6 +47,8 @@ def to_dict(self): result['units'] = self.units # 5 if self.set_value: result['set_value'] = self.set_value # 5 + if self.stop_time: + result['stop_time'] = self.stop_time # 5 if self.cov_increment: result['cov_increment'] = self.cov_increment # 5 return result diff --git a/schema/config_pointset_point.json b/schema/config_pointset_point.json index cf4d9bf692..7ae59da31b 100644 --- a/schema/config_pointset_point.json +++ b/schema/config_pointset_point.json @@ -18,6 +18,12 @@ "description": "Used for cloud writeback functionality, this field specifies the value for a given point in the device's current units.", "examples": [22.4] }, + "stop_time": { + "description": "RFC 3339 timestamp for the specified point write easing to stop", + "type": "string", + "format": "date-time", + "examples": ["2019-01-17T14:02:29.364Z"] + }, "cov_increment": { "type": "number", "description": "The CoV (change of value) increment, which when set, enables CoV on the point and defines the minimum change in present value of the respective point before an update is published", diff --git a/tests/schemas/config/easing.json b/tests/schemas/config/easing.json new file mode 100644 index 0000000000..123f881a78 --- /dev/null +++ b/tests/schemas/config/easing.json @@ -0,0 +1,19 @@ +{ + "version": "1.4.2", + "timestamp": "2018-08-26T21:39:29.364Z", + "pointset": { + "points": { + "room_temperature": { + "set_value": 37.3, + "stop_time": "2018-08-26T21:40:29.364Z" + }, + "hallway_temperature": { + "set_value": 37.3, + "stop_time": "2018-08-26T21:40:29.364Z" + }, + "hallway_lights": { + "set_value": false + } + } + } +} diff --git a/tests/schemas/config/easing.out b/tests/schemas/config/easing.out new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/schemas/config_pointset/easing.json b/tests/schemas/config_pointset/easing.json new file mode 100644 index 0000000000..8452df78b0 --- /dev/null +++ b/tests/schemas/config_pointset/easing.json @@ -0,0 +1,14 @@ +{ + "version": "1.4.2", + "timestamp": "2018-08-26T21:39:29.364Z", + "points": { + "room_temperature": { + "set_value": 37.3, + "stop_time": "2018-08-26T22:48:27Z" + }, + "hallway_temperature": { + "set_value": 37.3, + "stop_time": "2018-08-26T22:49:20Z" + } + } +} diff --git a/tests/schemas/config_pointset/easing.out b/tests/schemas/config_pointset/easing.out new file mode 100644 index 0000000000..e69de29bb2