From 4bdce9fe43b453ce754053030c803839efbde449 Mon Sep 17 00:00:00 2001 From: Krishna Iyer Date: Tue, 19 Nov 2024 14:46:44 +0100 Subject: [PATCH] Change contactState values to lowercase (#848) * Change contactState to lowercase values * Update codecs --- lib/payload.json | 2 +- vendor/dragino/lsn50-v2-codec.yaml | 2 +- vendor/dragino/lsn50-v2.js | 2 +- vendor/dragino/lsn50v2-s31-codec.yaml | 2 +- vendor/dragino/lsn50v2-s31.js | 2 +- vendor/milesight-iot/ws301-codec.yaml | 2 +- vendor/milesight-iot/ws301.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/payload.json b/lib/payload.json index 03e5a9f225..bee3110322 100644 --- a/lib/payload.json +++ b/lib/payload.json @@ -213,7 +213,7 @@ "contactState": { "type": "string", "description": "State of a contact sensor", - "enum": ["OPEN", "CLOSED"] + "enum": ["open", "closed"] } }, "additionalProperties": false diff --git a/vendor/dragino/lsn50-v2-codec.yaml b/vendor/dragino/lsn50-v2-codec.yaml index 141944d640..52570879fb 100644 --- a/vendor/dragino/lsn50-v2-codec.yaml +++ b/vendor/dragino/lsn50-v2-codec.yaml @@ -13,7 +13,7 @@ uplinkDecoder: temperature: 25.2 relativeHumidity: 51.7 action: - contactState: 'OPEN' + contactState: 'open' battery: 2.9 - description: Unknown FPort diff --git a/vendor/dragino/lsn50-v2.js b/vendor/dragino/lsn50-v2.js index c26628505c..61fe744775 100644 --- a/vendor/dragino/lsn50-v2.js +++ b/vendor/dragino/lsn50-v2.js @@ -206,7 +206,7 @@ function normalizeUplink(input) { relativeHumidity: input.data.Hum_SHT, }, action: { - contactState: input.data.Door_status === "CLOSE" ? "CLOSED" : input.data.Door_status === "OPEN" ? "OPEN" : undefined + contactState: input.data.Door_status === "CLOSE" ? "closed" : input.data.Door_status === "OPEN" ? "open" : undefined }, battery: input.data.BatV, } diff --git a/vendor/dragino/lsn50v2-s31-codec.yaml b/vendor/dragino/lsn50v2-s31-codec.yaml index e8607533d9..f936c835f2 100644 --- a/vendor/dragino/lsn50v2-s31-codec.yaml +++ b/vendor/dragino/lsn50v2-s31-codec.yaml @@ -13,7 +13,7 @@ uplinkDecoder: temperature: 25.2 relativeHumidity: 51.7 action: - contactState: 'OPEN' + contactState: 'open' battery: 2.9 - description: Unknown FPort input: diff --git a/vendor/dragino/lsn50v2-s31.js b/vendor/dragino/lsn50v2-s31.js index 9fef4d0eb1..dea7d1c7f5 100644 --- a/vendor/dragino/lsn50v2-s31.js +++ b/vendor/dragino/lsn50v2-s31.js @@ -107,7 +107,7 @@ function normalizeUplink(input) { relativeHumidity: input.data.Hum_SHT }, action: { - contactState: input.data.Door_status === "CLOSE" ? "CLOSED" : input.data.Door_status === "OPEN" ? "OPEN" : undefined + contactState: input.data.Door_status === "CLOSE" ? "closed" : input.data.Door_status === "OPEN" ? "open" : undefined }, battery: input.data.BatV, } diff --git a/vendor/milesight-iot/ws301-codec.yaml b/vendor/milesight-iot/ws301-codec.yaml index fdac30f692..1a20aaf956 100644 --- a/vendor/milesight-iot/ws301-codec.yaml +++ b/vendor/milesight-iot/ws301-codec.yaml @@ -13,7 +13,7 @@ uplinkDecoder: normalizedOutput: data: - action: - contactState: 'OPEN' + contactState: 'open' battery: 75 - description: Magnetic Contact Switch (example 2) - Milesight IoT input: diff --git a/vendor/milesight-iot/ws301.js b/vendor/milesight-iot/ws301.js index 4d3c7f4629..aafd67643a 100644 --- a/vendor/milesight-iot/ws301.js +++ b/vendor/milesight-iot/ws301.js @@ -49,7 +49,7 @@ function normalizeUplink(input) { return { data: { action: { - contactState: input.data.door === "close" ? "CLOSED" : input.data.door === "open" ? "OPEN" : undefined + contactState: input.data.door === "close" ? "closed" : input.data.door === "open" ? "open" : undefined }, battery: input.data.battery, }