From a6814c0f3193c785885bbf8c937b50529055d6a5 Mon Sep 17 00:00:00 2001 From: Mateus Silva Date: Thu, 30 May 2024 17:52:54 -0300 Subject: [PATCH 1/3] chore: Update schema to use object type for device parameters --- schema/connector_details.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/schema/connector_details.json b/schema/connector_details.json index d204009b..fd0fcf06 100644 --- a/schema/connector_details.json +++ b/schema/connector_details.json @@ -24,7 +24,7 @@ "type": "array", "description": "List of device parameters.", "items": { - "type": "string" + "type": "object" } }, "networks": { @@ -50,6 +50,9 @@ "description": "Multilingual support for device_annotation field" } }, - "required": ["description", "networks"], + "required": [ + "description", + "networks" + ], "additionalProperties": false -} \ No newline at end of file +} From 92608cea0ef8190f1c38e957ea769dad3480cae8 Mon Sep 17 00:00:00 2001 From: Mateus Silva Date: Thu, 30 May 2024 17:53:08 -0300 Subject: [PATCH 2/3] chore: Update beacon decoder type in payload-config.jsonc files --- .../v1.0.0/payload-config.jsonc | 21 +++++++++++++- .../v1.0.0/payload-config.jsonc | 20 ++++++++++++- .../micro-tracker/v1.0.0/payload-config.jsonc | 20 ++++++++++++- .../smart-badge/v1.0.0/payload-config.jsonc | 20 ++++++++++++- .../khomp/its-402/v1.0.0/payload-config.jsonc | 28 +++++++++++++++++-- 5 files changed, 103 insertions(+), 6 deletions(-) diff --git a/decoders/connector/abeeway/compact-tracker/v1.0.0/payload-config.jsonc b/decoders/connector/abeeway/compact-tracker/v1.0.0/payload-config.jsonc index a905cb3d..706686dc 100644 --- a/decoders/connector/abeeway/compact-tracker/v1.0.0/payload-config.jsonc +++ b/decoders/connector/abeeway/compact-tracker/v1.0.0/payload-config.jsonc @@ -4,7 +4,26 @@ "install_text": "**Compact tracker**\n\nMulti-mode tracker with embedded sensors combining GPS, Low-power GPS, Wi-Fi Sniffer, BLE and LoRaWAN TDoA geolocation technologies, supporting accurate outdoor and indoor geolocation.\n \nSolid and lightweight, built for heavy-duty tracking.\nAsset tracking and management, even in the harshest environments.\n3xAA 2.7Ah replaceable batteries, IP 68, ATEX*, temperature & motion sensors.\nUp to 4 years battery life in LP GPS at 24 fix per day.", "install_end_text": "", "device_annotation": "", - "device_parameters": [], + "device_parameters": [ + { + "name": "beacon_decoder", + "type": "dropdown", + "label": "Beacon decoder type", + "group": "main", + "options": [ + { + "is_default": false, + "label": "One variable with all beacons", + "value": "simple" + }, + { + "is_default": true, + "label": "Split beacon in different variables", + "value": "splitted" + } + ] + } + ], "networks": [ "../../../../network/lorawan-actility/v1.0.0/payload.js", "../../../../network/lorawan-chirpstack/v1.0.0/payload.js", diff --git a/decoders/connector/abeeway/industrial-tracker/v1.0.0/payload-config.jsonc b/decoders/connector/abeeway/industrial-tracker/v1.0.0/payload-config.jsonc index 77adff7a..7ee53205 100644 --- a/decoders/connector/abeeway/industrial-tracker/v1.0.0/payload-config.jsonc +++ b/decoders/connector/abeeway/industrial-tracker/v1.0.0/payload-config.jsonc @@ -4,7 +4,25 @@ "install_text": "**Industrial tracker**\n\nMulti-mode tracker with a large battery and embedded sensors combining GPS, Low-power GPS, Wi-Fi Sniffer, and LoRaWAN TDoA geolocation technologies, supporting accurate outdoor and indoor geolocation. \n\nLarge battery, hardened casing, high-precision tracking.\nDesigned to last IP65, 19Ah type D battery.\nUp to 3 years battery life in motion tracking mode at 120 position per day.", "install_end_text": "", "device_annotation": "", - "device_parameters": [], + "device_parameters": [ + { + "name": "beacon_decoder", + "type": "dropdown", + "options": [ + { + "is_default": false, + "label": "One variable with all beacon", + "value": "simple" + }, + { + "is_default": true, + "label": "Split beacon in different variables", + "value": "splitted" + } + ], + "label": "Beacon decoder type" + } + ], "networks": [ "../../../../network/lorawan-actility/v1.0.0/payload.js", "../../../../network/lorawan-chirpstack/v1.0.0/payload.js", diff --git a/decoders/connector/abeeway/micro-tracker/v1.0.0/payload-config.jsonc b/decoders/connector/abeeway/micro-tracker/v1.0.0/payload-config.jsonc index 6fb61379..995ae56c 100644 --- a/decoders/connector/abeeway/micro-tracker/v1.0.0/payload-config.jsonc +++ b/decoders/connector/abeeway/micro-tracker/v1.0.0/payload-config.jsonc @@ -4,7 +4,25 @@ "install_text": "**Micro tracker**\n\nMulti-mode tracker with embedded sensors combining GPS, Low-power GPS, Wi-Fi Sniffer, BLE and LoRaWAN TDoA geolocation technologies, for accurate outdoor and indoor geolocation. With its small size and long battery life.\n \nLight, handy, yet powerful. Enables you to track and protect things (or people and pets) of value.\nIP 65 – ATEX*, 450mAh rechargeable battery, Buzzer, multimode button.\n\nBattery life :\n* Proximity mode : 5 days to 2 weeks depending on data precision \n* Location mode : 90 days battery life at 40 fix per day with indoor/outdoor positioning.\n", "install_end_text": "", "device_annotation": "", - "device_parameters": [], + "device_parameters": [ + { + "name": "beacon_decoder", + "type": "dropdown", + "options": [ + { + "is_default": false, + "label": "One variable with all beacon", + "value": "simple" + }, + { + "is_default": true, + "label": "Split beacon in different variables", + "value": "splitted" + } + ], + "label": "Beacon decoder type" + } + ], "networks": [ "../../../../network/lorawan-actility/v1.0.0/payload.js", "../../../../network/lorawan-chirpstack/v1.0.0/payload.js", diff --git a/decoders/connector/abeeway/smart-badge/v1.0.0/payload-config.jsonc b/decoders/connector/abeeway/smart-badge/v1.0.0/payload-config.jsonc index 2626c3eb..b8b46170 100644 --- a/decoders/connector/abeeway/smart-badge/v1.0.0/payload-config.jsonc +++ b/decoders/connector/abeeway/smart-badge/v1.0.0/payload-config.jsonc @@ -4,7 +4,25 @@ "install_text": "**Smart Badge**\n\nMulti-mode tracker in ID card format with embedded sensors combining GPS, Low-power GPS, Wi-Fi Sniffer, BLE and LoRaWAN TDoA geolocation technologies, supporting accurate and continious outdoor and indoor geolocation. \n\nIdeal for worker protection and zone alerts, IP65, ATEX*, Buzzer with 70dB high volume, industrialized magnetic connector, 1300mAh rechargeable battery, multimode button.\n\nBattery life : \n* Proximity mode : 1 to 2 months depending on data precision\n* Location mode :120 days battery life at 60 fix per day with indoor/outdoor positioning.\n", "install_end_text": "", "device_annotation": "", - "device_parameters": [], + "device_parameters": [ + { + "name": "beacon_decoder", + "type": "dropdown", + "options": [ + { + "is_default": false, + "label": "One variable with all beacon", + "value": "simple" + }, + { + "is_default": true, + "label": "Split beacon in different variables", + "value": "splitted" + } + ], + "label": "Beacon decoder type" + } + ], "networks": [ "../../../../network/lorawan-chirpstack/v1.0.0/payload.js", "../../../../network/lorawan-actility/v1.0.0/payload.js", diff --git a/decoders/connector/khomp/its-402/v1.0.0/payload-config.jsonc b/decoders/connector/khomp/its-402/v1.0.0/payload-config.jsonc index 68603767..8f6cadde 100644 --- a/decoders/connector/khomp/its-402/v1.0.0/payload-config.jsonc +++ b/decoders/connector/khomp/its-402/v1.0.0/payload-config.jsonc @@ -4,8 +4,32 @@ "install_text": "**Khomp IoT Standalone with support for LTE Cat M1, NB-IOT 2 or GPRS networks**\n\nKhomp ITS 402 comunicates via LTE Cat M1, NB-IOT 2 or GPRS networks;\n\nFeatures include:\n* GPS with internal antenna and external antenna connector;\n* MQTT Integration;\n* Internal Relay;\n* Two dry contact or external temperature sensors;\n* Bluetooth Low Energy (BLE) integration for configs;\n\nAlso supports Khomp IoT extensors, including: Relay, Current (4-20 mA), Precision temperature probes and more.\n\n**[More information on official website.](https://www.khomp.com/en/categoria-de-produto/linha-iot-khomp/)**\n\n![](https://api.tago.io/file/5bbcb03b667d7a002e56664b/khomp/logo_khomp.png)", "install_end_text": "**Device created sucessful**\n\nDon't forget to create an action that triggers the configured MQTT Topic.\n\nParser supports English (EN), Portuguese (PT) and raw languages for value strings.\nChoose in the device configuration parameters.\n\n", "device_annotation": "Don't forget to create an action that triggers the configured MQTT Topic.\n\nParser supports English (EN), Portuguese (PT) and raw languages for value strings.\nChoose in the device configuration parameters.\n\n**[More information on official website.](https://www.khomp.com/en/categoria-de-produto/linha-iot-khomp/)**\n\n![](https://api.tago.io/file/5bbcb03b667d7a002e56664b/khomp/logo_khomp.png)", - "device_parameters": [], + "device_parameters": [ + { + "default": "", + "group": "advanced", + "label": "Available languages: PT, EN, raw", + "name": "language", + "type": "dropdown", + "options": [ + { + "is_default": true, + "label": "Português", + "value": "PT" + }, + { + "is_default": false, + "label": "English", + "value": "EN" + }, + { + "label": "Raw", + "value": "raw" + } + ] + } + ], "networks": [ "../../../../network/mqtt/v1.0.0/payload.js" ] -} \ No newline at end of file +} From 2289b72b0b38dd45ff6665877a902535aea332d7 Mon Sep 17 00:00:00 2001 From: Mateus Silva Date: Mon, 3 Jun 2024 11:48:48 -0300 Subject: [PATCH 3/3] chore: Update biome.jsonc to ignore specific decoder files in linter --- biome.jsonc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biome.jsonc b/biome.jsonc index abb48b54..7f79cf3a 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -11,7 +11,7 @@ }, "organizeImports": { "enabled": true }, "linter": { - "ignore": ["node_modules"], + "ignore": ["node_modules", "./decoders/**/v1.0.0/*.ts", "./decoders/**/v1.0.0/payload.js"], "enabled": true, "rules": { "recommended": true,