Skip to content

Commit 3aa4290

Browse files
fix(wt30x): clear_plan, reset all plan to default settings
1 parent 7f0e99c commit 3aa4290

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

vendors/milesight-iot/wt-series/wt303/wt303-codec.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,8 +2468,8 @@
24682468
"bacnet_unit_type": "UNITS_NO_UNITS"
24692469
},
24702470
{
2471-
"id": "clear_plan.all",
2472-
"name": "Clear Plan (all)",
2471+
"id": "clear_plan.reset",
2472+
"name": "Clear Plan (reset to default)",
24732473
"value": "",
24742474
"unit": "",
24752475
"access_mode": "W",

vendors/milesight-iot/wt-series/wt303/wt303-decoder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ function milesightDeviceDecode(bytes) {
643643
case 0x5f:
644644
decoded.clear_plan = decoded.clear_plan || {};
645645
var plan_data = readUInt8(bytes[i]);
646-
var plan_offset = { 0: "plan_1", 1: "plan_2", 2: "plan_3", 3: "plan_4", 4: "plan_5", 5: "plan_6", 6: "plan_7", 7: "plan_8", 8: "plan_9", 9: "plan_10", 10: "plan_11", 11: "plan_12", 12: "plan_13", 13: "plan_14", 14: "plan_15", 15: "plan_16", 255: "all" };
646+
var plan_offset = { 0: "plan_1", 1: "plan_2", 2: "plan_3", 3: "plan_4", 4: "plan_5", 5: "plan_6", 6: "plan_7", 7: "plan_8", 8: "plan_9", 9: "plan_10", 10: "plan_11", 11: "plan_12", 12: "plan_13", 13: "plan_14", 14: "plan_15", 15: "plan_16", 255: "reset" };
647647
decoded.clear_plan[plan_offset[plan_data]] = readYesNoStatus(1);
648648
i += 1;
649649
break;

vendors/milesight-iot/wt-series/wt303/wt303-encoder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @product WT303
77
*/
88
var RAW_VALUE = 0x01;
9-
var WITH_QUERY_CMD = 0x00;
9+
var WITH_QUERY_CMD = 0x01;
1010

1111
/* eslint no-redeclare: "off" */
1212
/* eslint-disable */
@@ -2313,11 +2313,11 @@ function setPlan(insert_plan_id) {
23132313
* @param {number} clear_plan.plan_14 values: (0: no, 1: yes)
23142314
* @param {number} clear_plan.plan_15 values: (0: no, 1: yes)
23152315
* @param {number} clear_plan.plan_16 values: (0: no, 1: yes)
2316-
* @param {number} clear_plan.all values: (0: no, 1: yes)
2316+
* @param {number} clear_plan.reset values: (0: no, 1: yes)
23172317
* @example { "clear_plan": { "plan_1": 1, "plan_2": 1, "plan_3": 1, "plan_4": 1, "plan_5": 1, "plan_6": 1, "plan_7": 1, "plan_8": 1, "plan_9": 1, "plan_10": 1 } }
23182318
*/
23192319
function clearPlan(clear_plan) {
2320-
var plan_index_map = { plan_1: 0, plan_2: 1, plan_3: 2, plan_4: 3, plan_5: 4, plan_6: 5, plan_7: 6, plan_8: 7, plan_9: 8, plan_10: 9, plan_11: 10, plan_12: 11, plan_13: 12, plan_14: 13, plan_15: 14, plan_16: 15, all: 255 };
2320+
var plan_index_map = { plan_1: 0, plan_2: 1, plan_3: 2, plan_4: 3, plan_5: 4, plan_6: 5, plan_7: 6, plan_8: 7, plan_9: 8, plan_10: 9, plan_11: 10, plan_12: 11, plan_13: 12, plan_14: 13, plan_15: 14, plan_16: 15, reset: 255 };
23212321
var yes_no_map = { 0: "no", 1: "yes" };
23222322
var yes_no_values = getValues(yes_no_map);
23232323

vendors/milesight-iot/wt-series/wt304/wt304-codec.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,8 +2768,8 @@
27682768
"bacnet_unit_type": "UNITS_NO_UNITS"
27692769
},
27702770
{
2771-
"id": "clear_plan.all",
2772-
"name": "Clear Plan (all)",
2771+
"id": "clear_plan.reset",
2772+
"name": "Clear Plan (reset to default)",
27732773
"value": "",
27742774
"unit": "",
27752775
"access_mode": "W",

vendors/milesight-iot/wt-series/wt304/wt304-decoder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ function milesightDeviceDecode(bytes) {
698698
case 0x5f:
699699
decoded.clear_plan = decoded.clear_plan || {};
700700
var plan_data = readUInt8(bytes[i]);
701-
var plan_offset = { 0: "plan_1", 1: "plan_2", 2: "plan_3", 3: "plan_4", 4: "plan_5", 5: "plan_6", 6: "plan_7", 7: "plan_8", 8: "plan_9", 9: "plan_10", 10: "plan_11", 11: "plan_12", 12: "plan_13", 13: "plan_14", 14: "plan_15", 15: "plan_16", 255: "all" };
701+
var plan_offset = { 0: "plan_1", 1: "plan_2", 2: "plan_3", 3: "plan_4", 4: "plan_5", 5: "plan_6", 6: "plan_7", 7: "plan_8", 8: "plan_9", 9: "plan_10", 10: "plan_11", 11: "plan_12", 12: "plan_13", 13: "plan_14", 14: "plan_15", 15: "plan_16", 255: "reset" };
702702
decoded.clear_plan[plan_offset[plan_data]] = readYesNoStatus(1);
703703
i += 1;
704704
break;

vendors/milesight-iot/wt-series/wt304/wt304-encoder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @product WT304
77
*/
88
var RAW_VALUE = 0x01;
9-
var WITH_QUERY_CMD = 0x00;
9+
var WITH_QUERY_CMD = 0x01;
1010

1111
/* eslint no-redeclare: "off" */
1212
/* eslint-disable */
@@ -2540,11 +2540,11 @@ function setPlan(insert_plan_id) {
25402540
* @param {number} clear_plan.plan_14 values: (0: no, 1: yes)
25412541
* @param {number} clear_plan.plan_15 values: (0: no, 1: yes)
25422542
* @param {number} clear_plan.plan_16 values: (0: no, 1: yes)
2543-
* @param {number} clear_plan.all values: (0: no, 1: yes)
2543+
* @param {number} clear_plan.reset values: (0: no, 1: yes)
25442544
* @example { "clear_plan": { "plan_1": 1, "plan_2": 1, "plan_3": 1, "plan_4": 1, "plan_5": 1, "plan_6": 1, "plan_7": 1, "plan_8": 1, "plan_9": 1, "plan_10": 1 } }
25452545
*/
25462546
function clearPlan(clear_plan) {
2547-
var plan_index_map = { plan_1: 0, plan_2: 1, plan_3: 2, plan_4: 3, plan_5: 4, plan_6: 5, plan_7: 6, plan_8: 7, plan_9: 8, plan_10: 9, plan_11: 10, plan_12: 11, plan_13: 12, plan_14: 13, plan_15: 14, plan_16: 15, all: 255 };
2547+
var plan_index_map = { plan_1: 0, plan_2: 1, plan_3: 2, plan_4: 3, plan_5: 4, plan_6: 5, plan_7: 6, plan_8: 7, plan_9: 8, plan_10: 9, plan_11: 10, plan_12: 11, plan_13: 12, plan_14: 13, plan_15: 14, plan_16: 15, reset: 255 };
25482548
var yes_no_map = { 0: "no", 1: "yes" };
25492549
var yes_no_values = getValues(yes_no_map);
25502550

version.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"date": "2025-09-17",
3-
"version": "1.5.9",
2+
"date": "2025-09-18",
3+
"version": "1.5.10",
44
"vendors": "vendors.json",
55
"link": "https://github.com/Milesight-IoT/codec/archive/refs/heads/release.zip"
66
}

0 commit comments

Comments
 (0)