node-red-contrib-zwave-js 7.2.0-beta.2 → 7.2.1-beta.5
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 +18 -0
- package/package.json +1 -1
- package/resources/UITab/client.js +44 -17
- package/zwave-js/ui/server.js +4 -0
- package/zwave-js/zwave-js.js +19 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# node-red-contrib-zwave-js Change Log
|
|
2
2
|
|
|
3
|
+
- 7.2.1
|
|
4
|
+
|
|
5
|
+
**New Features**
|
|
6
|
+
- Implemented a Firmware Update Service, that allows to install Firmware on devices that have known updates
|
|
7
|
+
- 2 new event types have been added : **ALIVE**, **DEAD** - these allow you to monitor if a device has been marked dead
|
|
8
|
+
or alive accordingly.
|
|
9
|
+
|
|
10
|
+
**Bug Fixes**
|
|
11
|
+
- Modal alerts are now rendering HTML content once again
|
|
12
|
+
- Missing `normalizedObject.label` for Thermostat devices
|
|
13
|
+
|
|
14
|
+
**Changes**
|
|
15
|
+
- Association Management has been updated, and changes are now applied in batch.
|
|
16
|
+
- For battery operated devices, certain UI actions now ask you to wake up said device before anything is comitted.
|
|
17
|
+
- Bump ZWave JS
|
|
18
|
+
- Bump Winston
|
|
19
|
+
- Bump ESlint
|
|
20
|
+
|
|
3
21
|
- 7.1.2
|
|
4
22
|
|
|
5
23
|
**Changes**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-zwave-js",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.1-beta.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The most powerful, high performing and highly polished Z-Wave node for Node-RED based on Z-Wave JS. If you want a fully featured Z-Wave framework in your Node-RED instance, you have found it.",
|
|
6
6
|
"dependencies": {
|
|
@@ -277,6 +277,9 @@ const ZwaveJsUI = (function () {
|
|
|
277
277
|
let HoveredNode = undefined; // Hovered Node
|
|
278
278
|
let selectedNode; // Selected Node
|
|
279
279
|
let LastTargetForBA; // BA TArget
|
|
280
|
+
let WakeResolver; // Resolve for wake wait
|
|
281
|
+
let WakeResolverTarget; // Target Wake Node
|
|
282
|
+
let NodesListed = false; // nodes listed
|
|
280
283
|
|
|
281
284
|
function modalAlert(message, title) {
|
|
282
285
|
const Buts = {
|
|
@@ -720,6 +723,24 @@ const ZwaveJsUI = (function () {
|
|
|
720
723
|
});
|
|
721
724
|
}
|
|
722
725
|
|
|
726
|
+
async function WaitForNodeWake(NodeID) {
|
|
727
|
+
const WD = modalPrompt(
|
|
728
|
+
'This device is asleep, please wake it up...',
|
|
729
|
+
'Waiting for device to wake up',
|
|
730
|
+
[],
|
|
731
|
+
false
|
|
732
|
+
);
|
|
733
|
+
|
|
734
|
+
WakeResolverTarget = NodeID;
|
|
735
|
+
await new Promise((res) => {
|
|
736
|
+
WakeResolver = res;
|
|
737
|
+
});
|
|
738
|
+
|
|
739
|
+
WakeResolver = undefined;
|
|
740
|
+
WakeResolverTarget = undefined;
|
|
741
|
+
WD.dialog('destroy');
|
|
742
|
+
}
|
|
743
|
+
|
|
723
744
|
function AssociationMGMT() {
|
|
724
745
|
ControllerCMD(
|
|
725
746
|
DCs.getAllAssociationGroups.API,
|
|
@@ -738,17 +759,13 @@ const ZwaveJsUI = (function () {
|
|
|
738
759
|
title: `ZWave Association Management: Node ${HoveredNode.nodeId}`,
|
|
739
760
|
minHeight: 75,
|
|
740
761
|
buttons: {
|
|
741
|
-
'Commit Changes': function () {
|
|
762
|
+
'Commit Changes': async function () {
|
|
742
763
|
const nodeRow = $('#zwave-js-node-list').find(
|
|
743
764
|
`[data-nodeid='${HoveredNode.nodeId}']`
|
|
744
765
|
);
|
|
745
766
|
|
|
746
767
|
if (nodeRow.data().info.status.toUpperCase() === 'ASLEEP') {
|
|
747
|
-
|
|
748
|
-
'This node is a sleep, please wake up the node before commiting Association changes',
|
|
749
|
-
'Node is a sleep'
|
|
750
|
-
);
|
|
751
|
-
return;
|
|
768
|
+
await WaitForNodeWake(HoveredNode.nodeId);
|
|
752
769
|
}
|
|
753
770
|
|
|
754
771
|
const Removals = $('#zwave-js-associations-table').find(
|
|
@@ -1152,7 +1169,7 @@ const ZwaveJsUI = (function () {
|
|
|
1152
1169
|
} else {
|
|
1153
1170
|
Nodes.forEach((N) => $('#zwave-js-node-list').append(renderNode(N)));
|
|
1154
1171
|
}
|
|
1155
|
-
|
|
1172
|
+
NodesListed = true;
|
|
1156
1173
|
$('#zwave-js-node-properties').treeList('empty');
|
|
1157
1174
|
})
|
|
1158
1175
|
.catch((err) => {
|
|
@@ -2438,17 +2455,13 @@ const ZwaveJsUI = (function () {
|
|
|
2438
2455
|
}
|
|
2439
2456
|
});
|
|
2440
2457
|
|
|
2441
|
-
CheckForUpdate = () => {
|
|
2458
|
+
CheckForUpdate = async () => {
|
|
2442
2459
|
const Node = parseInt($('#NODE_FWC option:selected').val());
|
|
2443
2460
|
|
|
2444
2461
|
const nodeRow = $('#zwave-js-node-list').find(`[data-nodeid='${Node}']`);
|
|
2445
2462
|
|
|
2446
2463
|
if (nodeRow.data().info.status.toUpperCase() === 'ASLEEP') {
|
|
2447
|
-
|
|
2448
|
-
'This node is a sleep, please wake up the node before checking for Firmware updates',
|
|
2449
|
-
'Node is a sleep'
|
|
2450
|
-
);
|
|
2451
|
-
return;
|
|
2464
|
+
await WaitForNodeWake(Node);
|
|
2452
2465
|
}
|
|
2453
2466
|
|
|
2454
2467
|
ControllerCMD(
|
|
@@ -2714,15 +2727,29 @@ const ZwaveJsUI = (function () {
|
|
|
2714
2727
|
const nodeRow = $('#zwave-js-node-list').find(
|
|
2715
2728
|
`[data-nodeid='${data.node}']`
|
|
2716
2729
|
);
|
|
2717
|
-
|
|
2730
|
+
|
|
2731
|
+
if (NodesListed) {
|
|
2732
|
+
nodeRow.data().info.status = data.status;
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2718
2735
|
if (data.status == 'READY') {
|
|
2719
2736
|
if (DriverReady) {
|
|
2720
2737
|
GetNodesThrottled();
|
|
2721
2738
|
}
|
|
2722
2739
|
} else {
|
|
2723
|
-
|
|
2724
|
-
.
|
|
2725
|
-
|
|
2740
|
+
if (
|
|
2741
|
+
data.node === WakeResolverTarget &&
|
|
2742
|
+
WakeResolver !== undefined &&
|
|
2743
|
+
(data.status.toUpperCase() === 'AWAKE' ||
|
|
2744
|
+
data.status.toUpperCase() === 'ALIVE')
|
|
2745
|
+
) {
|
|
2746
|
+
WakeResolver();
|
|
2747
|
+
}
|
|
2748
|
+
if (NodesListed) {
|
|
2749
|
+
nodeRow
|
|
2750
|
+
.find('.zwave-js-node-row-status')
|
|
2751
|
+
.html(renderStatusIcon(data.status.toUpperCase()));
|
|
2752
|
+
}
|
|
2726
2753
|
}
|
|
2727
2754
|
break;
|
|
2728
2755
|
}
|
package/zwave-js/ui/server.js
CHANGED
package/zwave-js/zwave-js.js
CHANGED
|
@@ -45,6 +45,8 @@ module.exports = function (RED) {
|
|
|
45
45
|
const event_ValueAdded = new SanitizedEventName('value added');
|
|
46
46
|
const event_Wake = new SanitizedEventName('wake up');
|
|
47
47
|
const event_Sleep = new SanitizedEventName('sleep');
|
|
48
|
+
const event_Dead = new SanitizedEventName('dead');
|
|
49
|
+
const event_Alive = new SanitizedEventName('alive');
|
|
48
50
|
const event_InterviewStarted = new SanitizedEventName('interview started');
|
|
49
51
|
const event_InterviewFailed = new SanitizedEventName('interview failed');
|
|
50
52
|
const event_InterviewCompleted = new SanitizedEventName(
|
|
@@ -1674,7 +1676,9 @@ module.exports = function (RED) {
|
|
|
1674
1676
|
} else {
|
|
1675
1677
|
let Name;
|
|
1676
1678
|
switch (VID.commandClass) {
|
|
1677
|
-
|
|
1679
|
+
// Thermostat Setpoint
|
|
1680
|
+
case 'Thermostat Setpoint':
|
|
1681
|
+
case 67:
|
|
1678
1682
|
Name = ZWaveJS.getEnumMemberName(
|
|
1679
1683
|
ZWaveJS.ThermostatSetpointType,
|
|
1680
1684
|
VID.propertyKey
|
|
@@ -1753,6 +1757,8 @@ module.exports = function (RED) {
|
|
|
1753
1757
|
'VALUE_UPDATED',
|
|
1754
1758
|
'SLEEP',
|
|
1755
1759
|
'WAKE_UP',
|
|
1760
|
+
'DEAD',
|
|
1761
|
+
'ALIVE',
|
|
1756
1762
|
'VALUE_ID_LIST',
|
|
1757
1763
|
'GET_VALUE_RESPONSE',
|
|
1758
1764
|
'GET_VALUE_METADATA_RESPONSE'
|
|
@@ -2025,11 +2031,11 @@ module.exports = function (RED) {
|
|
|
2025
2031
|
}
|
|
2026
2032
|
|
|
2027
2033
|
function WireNodeEvents(Node) {
|
|
2028
|
-
Node.
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
}
|
|
2034
|
+
if (Node.isControllerNode) {
|
|
2035
|
+
return;
|
|
2036
|
+
}
|
|
2032
2037
|
|
|
2038
|
+
Node.once(event_Ready.zwaveName, () => {
|
|
2033
2039
|
Node.on(event_FirmwareUpdateFinished.zwaveName, (N, S) => {
|
|
2034
2040
|
Send(N, event_FirmwareUpdateFinished.redName, S);
|
|
2035
2041
|
});
|
|
@@ -2064,6 +2070,14 @@ module.exports = function (RED) {
|
|
|
2064
2070
|
Node.on(event_Sleep.zwaveName, (N) => {
|
|
2065
2071
|
Send(N, event_Sleep.redName);
|
|
2066
2072
|
});
|
|
2073
|
+
|
|
2074
|
+
Node.on(event_Dead.zwaveName, (N) => {
|
|
2075
|
+
Send(N, event_Dead.redName);
|
|
2076
|
+
});
|
|
2077
|
+
|
|
2078
|
+
Node.on(event_Alive.zwaveName, (N) => {
|
|
2079
|
+
Send(N, event_Alive.redName);
|
|
2080
|
+
});
|
|
2067
2081
|
});
|
|
2068
2082
|
|
|
2069
2083
|
Node.on(event_InterviewStarted.zwaveName, (N) => {
|