node-red-contrib-zwave-js 6.5.0 → 6.5.1
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 +11 -0
- package/package.json +2 -2
- package/zwave-js/ui/client.js +61 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# node-red-contrib-zwave-js Change Log
|
|
2
2
|
|
|
3
|
+
- 6.5.1
|
|
4
|
+
|
|
5
|
+
**Fixes**
|
|
6
|
+
- Battery icon/popup text in the UI is now (finally) kept in sync.
|
|
7
|
+
- Driver readiness for Health Checks and Keep Alive requests in the UI
|
|
8
|
+
|
|
9
|
+
**Changes**
|
|
10
|
+
- Improvements to node redynees in the UI
|
|
11
|
+
- Bump ZWJS to 8.11.0
|
|
12
|
+
|
|
13
|
+
|
|
3
14
|
- 6.5.0
|
|
4
15
|
|
|
5
16
|
**New Features**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-zwave-js",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.1",
|
|
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": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"serialport": "9.2.8",
|
|
11
11
|
"winston": "^3.4.0",
|
|
12
12
|
"winston-transport": "^4.4.2",
|
|
13
|
-
"zwave-js": "^8.
|
|
13
|
+
"zwave-js": "^8.11.0",
|
|
14
14
|
"ip": "^1.1.5"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
package/zwave-js/ui/client.js
CHANGED
|
@@ -211,6 +211,7 @@ const ZwaveJsUI = (function () {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
function HealthCheck() {
|
|
214
|
+
IsDriverReady();
|
|
214
215
|
const Buttons = {
|
|
215
216
|
'Yes (1 Round)': () => {
|
|
216
217
|
RenderHealthCheck(1);
|
|
@@ -231,6 +232,7 @@ const ZwaveJsUI = (function () {
|
|
|
231
232
|
}
|
|
232
233
|
|
|
233
234
|
function KeepAwake() {
|
|
235
|
+
IsDriverReady();
|
|
234
236
|
const Node = $(
|
|
235
237
|
".red-ui-treeList-label.zwave-js-node-row[data-nodeid='" +
|
|
236
238
|
selectedNode +
|
|
@@ -1827,7 +1829,9 @@ const ZwaveJsUI = (function () {
|
|
|
1827
1829
|
`[data-nodeid='${data.node}']`
|
|
1828
1830
|
);
|
|
1829
1831
|
if (data.status == 'READY') {
|
|
1830
|
-
|
|
1832
|
+
if (DriverReady) {
|
|
1833
|
+
GetNodes();
|
|
1834
|
+
}
|
|
1831
1835
|
} else {
|
|
1832
1836
|
nodeRow
|
|
1833
1837
|
.find('.zwave-js-node-row-status')
|
|
@@ -1876,32 +1880,48 @@ const ZwaveJsUI = (function () {
|
|
|
1876
1880
|
}, 1000);
|
|
1877
1881
|
}
|
|
1878
1882
|
|
|
1883
|
+
const BatteryUIElements = {};
|
|
1879
1884
|
function renderBattery(node) {
|
|
1880
1885
|
const i = $('<i>');
|
|
1881
|
-
let Class;
|
|
1882
|
-
switch (node.powerSource.type) {
|
|
1883
|
-
case 'mains':
|
|
1884
|
-
i.addClass('fa fa-plug');
|
|
1885
|
-
RED.popover.tooltip(i, 'Mains Powered');
|
|
1886
|
-
break;
|
|
1887
|
-
default:
|
|
1888
|
-
node.powerSource.level > 90
|
|
1889
|
-
? (Class = 'fa fa-battery-full')
|
|
1890
|
-
: node.powerSource.level > 65
|
|
1891
|
-
? (Class = 'fa fa-battery-three-quarters')
|
|
1892
|
-
: node.powerSource.level > 35
|
|
1893
|
-
? (Class = 'fa fa-battery-half')
|
|
1894
|
-
: node.powerSource.level > 10
|
|
1895
|
-
? (Class = 'fa fa-battery-quarter')
|
|
1896
|
-
: (Class = 'fa fa-battery-empty');
|
|
1897
1886
|
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1887
|
+
if (node.interviewStage === 'Complete') {
|
|
1888
|
+
switch (node.powerSource.type) {
|
|
1889
|
+
case 'mains':
|
|
1890
|
+
i.addClass('fa fa-plug');
|
|
1891
|
+
BatteryUIElements[node.nodeId] = RED.popover.tooltip(
|
|
1892
|
+
i,
|
|
1893
|
+
'Mains Powered'
|
|
1894
|
+
);
|
|
1895
|
+
break;
|
|
1903
1896
|
|
|
1904
|
-
|
|
1897
|
+
default:
|
|
1898
|
+
let Class;
|
|
1899
|
+
node.powerSource.level > 90
|
|
1900
|
+
? (Class = 'fa fa-battery-full')
|
|
1901
|
+
: node.powerSource.level > 65
|
|
1902
|
+
? (Class = 'fa fa-battery-three-quarters')
|
|
1903
|
+
: node.powerSource.level > 35
|
|
1904
|
+
? (Class = 'fa fa-battery-half')
|
|
1905
|
+
: node.powerSource.level > 10
|
|
1906
|
+
? (Class = 'fa fa-battery-quarter')
|
|
1907
|
+
: (Class = 'fa fa-battery-empty');
|
|
1908
|
+
|
|
1909
|
+
if (node.powerSource.isLow) {
|
|
1910
|
+
i.css({ color: 'red' });
|
|
1911
|
+
}
|
|
1912
|
+
i.addClass(Class);
|
|
1913
|
+
BatteryUIElements[node.nodeId] = RED.popover.tooltip(
|
|
1914
|
+
i,
|
|
1915
|
+
'Level: ' + node.powerSource.level
|
|
1916
|
+
);
|
|
1917
|
+
}
|
|
1918
|
+
} else {
|
|
1919
|
+
i.addClass('fa fa-hourglass');
|
|
1920
|
+
BatteryUIElements[node.nodeId] = RED.popover.tooltip(
|
|
1921
|
+
i,
|
|
1922
|
+
'Power Source not yet known'
|
|
1923
|
+
);
|
|
1924
|
+
}
|
|
1905
1925
|
return i;
|
|
1906
1926
|
}
|
|
1907
1927
|
|
|
@@ -1958,7 +1978,11 @@ const ZwaveJsUI = (function () {
|
|
|
1958
1978
|
.addClass('red-ui-treeList-label zwave-js-node-row')
|
|
1959
1979
|
.attr('data-nodeid', node.nodeId)
|
|
1960
1980
|
.data('info', node)
|
|
1961
|
-
.click(() =>
|
|
1981
|
+
.click(() => {
|
|
1982
|
+
node.ready
|
|
1983
|
+
? selectNode(node.nodeId)
|
|
1984
|
+
: modalAlert('This node is not ready', 'Node Not Ready');
|
|
1985
|
+
})
|
|
1962
1986
|
.append(
|
|
1963
1987
|
$('<div>').html(node.nodeId).addClass('zwave-js-node-row-id'),
|
|
1964
1988
|
$('<div>').html(node.name).addClass('zwave-js-node-row-name'),
|
|
@@ -1966,7 +1990,7 @@ const ZwaveJsUI = (function () {
|
|
|
1966
1990
|
.html(renderStatusIcon(node.status.toUpperCase()))
|
|
1967
1991
|
.addClass('zwave-js-node-row-status'),
|
|
1968
1992
|
$('<div>')
|
|
1969
|
-
.html(renderReadyIcon(node
|
|
1993
|
+
.html(renderReadyIcon(node))
|
|
1970
1994
|
.addClass('zwave-js-node-row-ready'),
|
|
1971
1995
|
$('<div>')
|
|
1972
1996
|
.html(renderBattery(node))
|
|
@@ -1975,12 +1999,17 @@ const ZwaveJsUI = (function () {
|
|
|
1975
1999
|
);
|
|
1976
2000
|
}
|
|
1977
2001
|
|
|
1978
|
-
function renderReadyIcon(
|
|
2002
|
+
function renderReadyIcon(node) {
|
|
1979
2003
|
const i = $('<i>');
|
|
1980
2004
|
|
|
1981
|
-
if (
|
|
1982
|
-
i.addClass('fa fa-
|
|
1983
|
-
RED.popover.tooltip(i, '
|
|
2005
|
+
if (node.interviewStage !== 'Complete') {
|
|
2006
|
+
i.addClass('fa fa-hourglass');
|
|
2007
|
+
RED.popover.tooltip(i, 'Pending Completed Interview');
|
|
2008
|
+
} else {
|
|
2009
|
+
if (node.ready) {
|
|
2010
|
+
i.addClass('fa fa-thumbs-up');
|
|
2011
|
+
RED.popover.tooltip(i, 'Ready');
|
|
2012
|
+
}
|
|
1984
2013
|
}
|
|
1985
2014
|
|
|
1986
2015
|
return i;
|
|
@@ -2339,7 +2368,9 @@ const ZwaveJsUI = (function () {
|
|
|
2339
2368
|
: (Class = 'fa fa-battery-empty');
|
|
2340
2369
|
BatterySymbol.removeClass();
|
|
2341
2370
|
BatterySymbol.addClass(Class);
|
|
2342
|
-
|
|
2371
|
+
BatteryUIElements[data.node].setContent(
|
|
2372
|
+
'Level: ' + data.payload.newValue
|
|
2373
|
+
);
|
|
2343
2374
|
break;
|
|
2344
2375
|
|
|
2345
2376
|
case 'isLow':
|