node-red-contrib-zwave-js 6.4.0-beta.6 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/package.json +5 -5
- package/zwave-js/event-filter.js +12 -5
- package/zwave-js/ui/client.js +33 -7
- package/zwave-js/zwave-js.html +11 -1
- package/zwave-js/zwave-js.js +44 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,15 +8,20 @@
|
|
|
8
8
|
- Device nodes now clone the received network message, removing a situation where filter node outputs,
|
|
9
9
|
are affected by other device nodes having the same interest in the object.
|
|
10
10
|
- Account for 3 digit node ID's in UI
|
|
11
|
+
- Fixed `event-filter` ignoring `strict `mode
|
|
11
12
|
|
|
12
13
|
**New Features**
|
|
13
14
|
- Implemented Zwave S2 Security Smart Start.
|
|
14
15
|
This includes a new mobile UI, allowing you to use it as a device inclusion tool.
|
|
16
|
+
- Expose further driver timeout options
|
|
15
17
|
|
|
16
18
|
**Changes**
|
|
17
19
|
- Controller ready checks are now made prior to showing any UI modal form, that may depend on the controller.
|
|
18
20
|
- The battery icon in the node list is now updated, whenever a device transmits an update.
|
|
19
|
-
-
|
|
21
|
+
- JSON Keys are now quoted in the UI monitor.
|
|
22
|
+
- The **timestamp** value in event messages are now the time in milliseconds from the unix epoch.
|
|
23
|
+
- Bump ZWJS to 8.8.2
|
|
24
|
+
- Bump serial port to 9.2.8
|
|
20
25
|
|
|
21
26
|
- 6.3.0
|
|
22
27
|
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-zwave-js",
|
|
3
|
-
"version": "6.4.0
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "An extremely powerful, easy to use, and feature rich Z-Wave node for Node Red, based on Z-Wave JS.",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"express": "^4.17.1",
|
|
8
8
|
"limiter": "^2.1.0",
|
|
9
9
|
"lodash": "^4.17.21",
|
|
10
|
-
"serialport": "9.2.
|
|
10
|
+
"serialport": "9.2.8",
|
|
11
11
|
"winston": "^3.3.3",
|
|
12
12
|
"winston-transport": "^4.4.0",
|
|
13
|
-
"zwave-js": "^8.
|
|
13
|
+
"zwave-js": "^8.8.2",
|
|
14
14
|
"ip": "^1.1.5"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"eslint": "^8.
|
|
18
|
-
"prettier": "^2.
|
|
17
|
+
"eslint": "^8.3.0",
|
|
18
|
+
"prettier": "^2.5.0"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=12.22.2",
|
package/zwave-js/event-filter.js
CHANGED
|
@@ -36,7 +36,14 @@ module.exports = function (RED) {
|
|
|
36
36
|
if (Filter.events.includes(msg.payload.event)) {
|
|
37
37
|
if (Filter.valueIds.length > 0) {
|
|
38
38
|
for (const ValueID of Filter.valueIds) {
|
|
39
|
-
if (
|
|
39
|
+
if (
|
|
40
|
+
IsValueIDMatch(
|
|
41
|
+
ValueID,
|
|
42
|
+
msg,
|
|
43
|
+
msg.payload.event,
|
|
44
|
+
Filter.strict
|
|
45
|
+
)
|
|
46
|
+
) {
|
|
40
47
|
msg.filter = Filter;
|
|
41
48
|
SendingArray[ArrayIndex] = msg;
|
|
42
49
|
node.status({
|
|
@@ -88,12 +95,12 @@ module.exports = function (RED) {
|
|
|
88
95
|
}
|
|
89
96
|
}
|
|
90
97
|
|
|
91
|
-
function IsValueIDMatch(ValueID, MSG, Event) {
|
|
98
|
+
function IsValueIDMatch(ValueID, MSG, Event, Strict) {
|
|
92
99
|
let Root = MSG.payload.object;
|
|
93
100
|
|
|
94
101
|
if (Event === 'GET_VALUE_RESPONSE') {
|
|
95
102
|
Root = Root.valueId;
|
|
96
|
-
if (!
|
|
103
|
+
if (!Strict) {
|
|
97
104
|
delete ValueID['endpoint'];
|
|
98
105
|
}
|
|
99
106
|
const Result = LD.isMatch(Root, ValueID);
|
|
@@ -101,7 +108,7 @@ module.exports = function (RED) {
|
|
|
101
108
|
}
|
|
102
109
|
|
|
103
110
|
if (Event === 'VALUE_UPDATED') {
|
|
104
|
-
if (!
|
|
111
|
+
if (!Strict) {
|
|
105
112
|
delete ValueID['endpoint'];
|
|
106
113
|
}
|
|
107
114
|
const Result = LD.isMatch(Root, ValueID);
|
|
@@ -114,7 +121,7 @@ module.exports = function (RED) {
|
|
|
114
121
|
}
|
|
115
122
|
|
|
116
123
|
if (Event === 'VALUE_NOTIFICATION') {
|
|
117
|
-
if (!
|
|
124
|
+
if (!Strict) {
|
|
118
125
|
delete ValueID['endpoint'];
|
|
119
126
|
}
|
|
120
127
|
const Result = LD.isMatch(Root, ValueID);
|
package/zwave-js/ui/client.js
CHANGED
|
@@ -36,7 +36,7 @@ JSONFormatter.json = {
|
|
|
36
36
|
var val = '<span class=json-value>';
|
|
37
37
|
var str = '<span class=json-string>';
|
|
38
38
|
var r = pIndent || '';
|
|
39
|
-
if (pKey) r = r + key + pKey
|
|
39
|
+
if (pKey) r = r + key + pKey + '</span>';
|
|
40
40
|
if (pVal) r = r + (pVal[0] == '"' ? str : val) + pVal + '</span>';
|
|
41
41
|
return r + (pEnd || '');
|
|
42
42
|
},
|
|
@@ -825,6 +825,7 @@ const ZwaveJsUI = (function () {
|
|
|
825
825
|
|
|
826
826
|
case 'EditSmartStart':
|
|
827
827
|
StepsAPI.setStepIndex(StepList.SmartStartListEdit);
|
|
828
|
+
$('#SSPurgeButton').css({ display: 'inline-block' });
|
|
828
829
|
$.ajax({
|
|
829
830
|
url: 'zwave-js/smart-start-list',
|
|
830
831
|
method: 'GET',
|
|
@@ -941,6 +942,7 @@ const ZwaveJsUI = (function () {
|
|
|
941
942
|
};
|
|
942
943
|
|
|
943
944
|
function ShowIncludeExcludePrompt() {
|
|
945
|
+
const ParentDialog = $('<div>').css({ padding: 10 }).html('Please wait...');
|
|
944
946
|
const Options = {
|
|
945
947
|
draggable: false,
|
|
946
948
|
modal: true,
|
|
@@ -950,6 +952,30 @@ const ZwaveJsUI = (function () {
|
|
|
950
952
|
title: 'Node Inclusion/Exclusion',
|
|
951
953
|
minHeight: 75,
|
|
952
954
|
buttons: [
|
|
955
|
+
{
|
|
956
|
+
id: 'SSPurgeButton',
|
|
957
|
+
text: 'Remove All',
|
|
958
|
+
click: function () {
|
|
959
|
+
const Buttons = {
|
|
960
|
+
'Yes - Remove': function () {
|
|
961
|
+
ControllerCMD(
|
|
962
|
+
'IEAPI',
|
|
963
|
+
'unprovisionAllSmartStart',
|
|
964
|
+
undefined,
|
|
965
|
+
undefined,
|
|
966
|
+
true
|
|
967
|
+
);
|
|
968
|
+
ParentDialog.dialog('destroy');
|
|
969
|
+
}
|
|
970
|
+
};
|
|
971
|
+
modalPrompt(
|
|
972
|
+
'Are you sure you wish to remove all pre-provisioned device entries (the devices them self wont be removed)',
|
|
973
|
+
'Purge Provisioning List',
|
|
974
|
+
Buttons,
|
|
975
|
+
true
|
|
976
|
+
);
|
|
977
|
+
}
|
|
978
|
+
},
|
|
953
979
|
{
|
|
954
980
|
id: 'IEButton',
|
|
955
981
|
text: 'Abort',
|
|
@@ -961,7 +987,7 @@ const ZwaveJsUI = (function () {
|
|
|
961
987
|
ClearIETimer();
|
|
962
988
|
ClearSecurityCountDown();
|
|
963
989
|
ControllerCMD('IEAPI', 'stop', undefined, undefined, true);
|
|
964
|
-
|
|
990
|
+
ParentDialog.dialog('destroy');
|
|
965
991
|
}
|
|
966
992
|
},
|
|
967
993
|
{
|
|
@@ -988,22 +1014,22 @@ const ZwaveJsUI = (function () {
|
|
|
988
1014
|
id: 'IEClose',
|
|
989
1015
|
text: 'Ok',
|
|
990
1016
|
click: function () {
|
|
991
|
-
|
|
1017
|
+
ParentDialog.dialog('destroy');
|
|
992
1018
|
}
|
|
993
1019
|
}
|
|
994
1020
|
]
|
|
995
1021
|
};
|
|
996
1022
|
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
IncludeForm.html('');
|
|
1023
|
+
ParentDialog.dialog(Options);
|
|
1024
|
+
ParentDialog.html('');
|
|
1000
1025
|
|
|
1001
|
-
|
|
1026
|
+
ParentDialog.append($('#TPL_Include').html());
|
|
1002
1027
|
const Steps = $('#IncludeWizard').steps({ showFooterButtons: false });
|
|
1003
1028
|
StepsAPI = Steps.data('plugin_Steps');
|
|
1004
1029
|
|
|
1005
1030
|
$('#SmartStartCommit').css({ display: 'none' });
|
|
1006
1031
|
$('#IEClose').css({ display: 'none' });
|
|
1032
|
+
$('#SSPurgeButton').css({ display: 'none' });
|
|
1007
1033
|
}
|
|
1008
1034
|
|
|
1009
1035
|
function ShowReplacePrompt() {
|
package/zwave-js/zwave-js.html
CHANGED
|
@@ -500,7 +500,7 @@
|
|
|
500
500
|
<p>The scanned devices have now been added to a provisioning list.</p>
|
|
501
501
|
<p>Once the devices have been powered up, they should broadcast a 'Here
|
|
502
502
|
I Am' type message.</p>
|
|
503
|
-
<p>The rate at which this happens, is down the device, but once the
|
|
503
|
+
<p>The rate at which this happens, is down to the device, but once the
|
|
504
504
|
broadcast has been recieved, the device should get interviewed and
|
|
505
505
|
added to your network.</p>
|
|
506
506
|
</div>
|
|
@@ -763,6 +763,8 @@
|
|
|
763
763
|
ackTimeout: { value: undefined },
|
|
764
764
|
controllerTimeout: { value: undefined },
|
|
765
765
|
sendResponseTimeout: { value: undefined },
|
|
766
|
+
sendDataCallback: { value: undefined },
|
|
767
|
+
serialAPIStarted: { value: undefined },
|
|
766
768
|
logLevelPin: { value: 'none' },
|
|
767
769
|
logLevel: { value: 'none' },
|
|
768
770
|
logFile: { value: undefined },
|
|
@@ -914,6 +916,10 @@
|
|
|
914
916
|
<label for="node-input-controllerTimeout" style="width:130px"><i class="fa fa-pencil"></i> Controller</label>
|
|
915
917
|
<input type="text" id="node-input-controllerTimeout" placeholder="Use Default">
|
|
916
918
|
</div>
|
|
919
|
+
<div class="form-row">
|
|
920
|
+
<label for="node-input-sendDataCallback" style="width:130px"><i class="fa fa-pencil"></i> Callback</label>
|
|
921
|
+
<input type="text" id="node-input-sendDataCallback" placeholder="Use Default">
|
|
922
|
+
</div>
|
|
917
923
|
<div class="form-row">
|
|
918
924
|
<label for="node-input-sendResponseTimeout" style="width:130px"><i class="fa fa-pencil"></i> Req -> Res</label>
|
|
919
925
|
<input type="text" id="node-input-sendResponseTimeout" placeholder="Use Default">
|
|
@@ -978,6 +984,10 @@
|
|
|
978
984
|
<label for="node-input-softResetUSB" style="width:130px"><i class="fa fa-pencil"></i> Soft Reset USB</label>
|
|
979
985
|
<input type="checkbox" id="node-input-softResetUSB">
|
|
980
986
|
</div>
|
|
987
|
+
<div class="form-row">
|
|
988
|
+
<label for="node-input-serialAPIStarted" style="width:130px"><i class="fa fa-pencil"></i> SR Timeout</label>
|
|
989
|
+
<input type="text" id="node-input-serialAPIStarted" placeholder="Use Default">
|
|
990
|
+
</div>
|
|
981
991
|
<br />
|
|
982
992
|
<p>
|
|
983
993
|
<strong>Version Information</strong>
|
package/zwave-js/zwave-js.js
CHANGED
|
@@ -236,6 +236,23 @@ module.exports = function (RED) {
|
|
|
236
236
|
'Enabled'
|
|
237
237
|
);
|
|
238
238
|
DriverOptions.enableSoftReset = true;
|
|
239
|
+
|
|
240
|
+
if (
|
|
241
|
+
config.serialAPIStarted !== undefined &&
|
|
242
|
+
config.serialAPIStarted.length > 0
|
|
243
|
+
) {
|
|
244
|
+
Log(
|
|
245
|
+
'debug',
|
|
246
|
+
'NDERED',
|
|
247
|
+
undefined,
|
|
248
|
+
'[options] [timeouts.serialAPIStarted]',
|
|
249
|
+
config.serialAPIStarted
|
|
250
|
+
);
|
|
251
|
+
DriverOptions.timeouts = {};
|
|
252
|
+
DriverOptions.timeouts.serialAPIStarted = parseInt(
|
|
253
|
+
config.serialAPIStarted
|
|
254
|
+
);
|
|
255
|
+
}
|
|
239
256
|
} else {
|
|
240
257
|
Log(
|
|
241
258
|
'debug',
|
|
@@ -293,7 +310,9 @@ module.exports = function (RED) {
|
|
|
293
310
|
}
|
|
294
311
|
|
|
295
312
|
// Timeout
|
|
296
|
-
DriverOptions.timeouts
|
|
313
|
+
if (!DriverOptions.hasOwnProperty('timeouts')) {
|
|
314
|
+
DriverOptions.timeouts = {};
|
|
315
|
+
}
|
|
297
316
|
if (config.ackTimeout !== undefined && config.ackTimeout.length > 0) {
|
|
298
317
|
Log(
|
|
299
318
|
'debug',
|
|
@@ -317,6 +336,21 @@ module.exports = function (RED) {
|
|
|
317
336
|
);
|
|
318
337
|
DriverOptions.timeouts.response = parseInt(config.controllerTimeout);
|
|
319
338
|
}
|
|
339
|
+
if (
|
|
340
|
+
config.sendDataCallback !== undefined &&
|
|
341
|
+
config.sendDataCallback.length > 0
|
|
342
|
+
) {
|
|
343
|
+
Log(
|
|
344
|
+
'debug',
|
|
345
|
+
'NDERED',
|
|
346
|
+
undefined,
|
|
347
|
+
'[options] [timeouts.sendDataCallback]',
|
|
348
|
+
config.sendDataCallback
|
|
349
|
+
);
|
|
350
|
+
DriverOptions.timeouts.sendDataCallback = parseInt(
|
|
351
|
+
config.sendDataCallback
|
|
352
|
+
);
|
|
353
|
+
}
|
|
320
354
|
if (
|
|
321
355
|
config.sendResponseTimeout !== undefined &&
|
|
322
356
|
config.sendResponseTimeout.length > 0
|
|
@@ -530,6 +564,14 @@ module.exports = function (RED) {
|
|
|
530
564
|
CheckKey(Params[0]);
|
|
531
565
|
break;
|
|
532
566
|
|
|
567
|
+
case 'unprovisionAllSmartStart':
|
|
568
|
+
const Entries = Driver.controller.getProvisioningEntries();
|
|
569
|
+
for (let i = 0; i < Entries.length; i++) {
|
|
570
|
+
const Entry = Entries[i];
|
|
571
|
+
Driver.controller.unprovisionSmartStartNode(Entry.dsk);
|
|
572
|
+
}
|
|
573
|
+
break;
|
|
574
|
+
|
|
533
575
|
case 'unprovisionSmartStartNode':
|
|
534
576
|
Driver.controller.unprovisionSmartStartNode(Params[0]);
|
|
535
577
|
break;
|
|
@@ -1331,7 +1373,7 @@ module.exports = function (RED) {
|
|
|
1331
1373
|
}
|
|
1332
1374
|
}
|
|
1333
1375
|
PL.event = Subject;
|
|
1334
|
-
PL.timestamp = new Date().
|
|
1376
|
+
PL.timestamp = new Date().getTime();
|
|
1335
1377
|
if (Value !== undefined) {
|
|
1336
1378
|
PL.object = Value;
|
|
1337
1379
|
}
|