Skip to content

Commit 66235a8

Browse files
Bump driver to v14 (#292)
* Boom! * Patch out config update * add external dir (re-add updates) * Update CHANGELOG.md * Update CHANGELOG.md
1 parent 6206641 commit 66235a8

File tree

4 files changed

+50
-17
lines changed

4 files changed

+50
-17
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# node-red-contrib-zwave-js Change Log
22

3+
- 9.1.0
4+
5+
**Changes**
6+
- Bump ZWave JS from v12 to V14 + other dependencies
7+
8+
**New Features**
9+
- Added ability to set the base config directory.
10+
Note: Installing configuration updates, now requires this to be utilised.
11+
This not considered a breaking change, as it does not affect use.
12+
313
- 9.0.4
414

515
**Maintenance Release**

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"name": "node-red-contrib-zwave-js",
3-
"version": "9.0.4",
3+
"version": "9.1.0",
44
"license": "MIT",
55
"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.",
66
"dependencies": {
77
"limiter": "^2.1.0",
88
"lodash": "^4.17.21",
9-
"winston": "^3.13.0",
10-
"winston-transport": "^4.7.0",
11-
"zwave-js": "^12.5.6"
9+
"winston": "^3.17.0",
10+
"winston-transport": "^4.9.0",
11+
"zwave-js": "^14.3.3"
1212
},
1313
"devDependencies": {
14-
"eslint": "^9.1.1",
15-
"prettier": "^3.2.5"
14+
"eslint": "^9.15.0",
15+
"prettier": "^3.3.3"
1616
},
1717
"scripts": {
1818
"validate": "node-red-dev validate -o validation_result.json"

zwave-js/zwave-js.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,6 +1030,7 @@
10301030
sendUsageStatistics: { value: true },
10311031
valueCacheDiskThrottle: { value: 'normal' },
10321032
customConfigPath: { value: undefined },
1033+
baseConfigPath: { value: undefined },
10331034
intvwUserCodes: { value: false },
10341035
softResetUSB: { value: false },
10351036
outputs: { value: 1 },
@@ -1316,9 +1317,13 @@
13161317
<strong>Advanced Driver Settings</strong>
13171318
</p>
13181319
<div class="form-row">
1319-
<label for="node-input-customConfigPath" style="width:130px"><i class="fa fa-pencil"></i> Custom CFG Dir</label>
1320+
<label for="node-input-customConfigPath" style="width:130px"><i class="fa fa-pencil"></i> Priority CFG Dir</label>
13201321
<input type="text" id="node-input-customConfigPath" placeholder="/some/directory" style="width: calc(100% - 135px)">
13211322
</div>
1323+
<div class="form-row">
1324+
<label for="node-input-baseConfigPath" style="width:130px"><i class="fa fa-pencil"></i> Base CFG Dir</label>
1325+
<input type="text" id="node-input-baseConfigPath" placeholder="Use Default" style="width: calc(100% - 135px)">
1326+
</div>
13221327
<div class="form-row">
13231328
<label for="node-input-valueCacheDiskThrottle" style="width:130px"><i class="fa fa-pencil"></i> Disk IO Throttle</label>
13241329
<select id="node-input-valueCacheDiskThrottle" style="width: calc(100% - 135px)">

zwave-js/zwave-js.js

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -310,16 +310,19 @@ module.exports = function (RED) {
310310
DriverOptions.disableOptimisticValueUpdate = false;
311311
}
312312

313+
DriverOptions.features = {};
314+
313315
// Soft Reset
314316
if (config.softResetUSB !== undefined && config.softResetUSB) {
315317
Log(
316318
'debug',
317319
'NDERED',
318320
undefined,
319-
'[options] [enableSoftReset]',
321+
'[options] [features.softReset]',
320322
'Enabled'
321323
);
322-
DriverOptions.enableSoftReset = true;
324+
325+
DriverOptions.features.softReset = true;
323326

324327
if (
325328
config.serialAPIStarted !== undefined &&
@@ -342,10 +345,10 @@ module.exports = function (RED) {
342345
'debug',
343346
'NDERED',
344347
undefined,
345-
'[options] [enableSoftReset]',
348+
'[options] [features.softReset]',
346349
'Disabled'
347350
);
348-
DriverOptions.enableSoftReset = false;
351+
DriverOptions.features.softReset = true;
349352
}
350353

351354
DriverOptions.storage = {};
@@ -378,6 +381,20 @@ module.exports = function (RED) {
378381
DriverOptions.storage.deviceConfigPriorityDir = config.customConfigPath;
379382
}
380383

384+
if (
385+
config.baseConfigPath !== undefined &&
386+
config.baseConfigPath.length > 0
387+
) {
388+
Log(
389+
'debug',
390+
'NDERED',
391+
undefined,
392+
'[options] [storage.deviceConfigExternalDir]',
393+
config.baseConfigPath
394+
);
395+
DriverOptions.storage.deviceConfigExternalDir = config.baseConfigPath;
396+
}
397+
381398
// Disk throttle
382399
if (
383400
config.valueCacheDiskThrottle !== undefined &&
@@ -1166,9 +1183,9 @@ module.exports = function (RED) {
11661183
if (SupportsNN) {
11671184
await Driver.controller.nodes
11681185
.get(Params[0])
1169-
.commandClasses['Node Naming and Location'].setLocation(
1170-
Params[1]
1171-
);
1186+
.commandClasses[
1187+
'Node Naming and Location'
1188+
].setLocation(Params[1]);
11721189
}
11731190
ReturnNode.id = Params[0];
11741191
Send(ReturnNode, 'NODE_LOCATION_SET', Params[1], send);
@@ -1705,7 +1722,8 @@ module.exports = function (RED) {
17051722
NodeCheck(Params[0].nodeId);
17061723
Params[2].forEach((A) => {
17071724
if (
1708-
!Driver.controller.isAssociationAllowed(Params[0], Params[1], A)
1725+
Driver.controller.checkAssociation(Params[0], Params[1], A) !==
1726+
ZWaveJS.AssociationCheckResult.OK
17091727
) {
17101728
const ErrorMSG = `Association: Source -> ${JSON.stringify(
17111729
Params[0]
@@ -2072,9 +2090,9 @@ module.exports = function (RED) {
20722090
});
20732091

20742092
// Include
2075-
Driver.controller.on(event_InclusionStarted.zwaveName, (Secure) => {
2093+
Driver.controller.on(event_InclusionStarted.zwaveName, (strategy) => {
20762094
Send(undefined, event_InclusionStarted.redName, {
2077-
isSecureInclude: Secure
2095+
isSecureInclude: strategy !== ZWaveJS.InclusionStrategy.Insecure
20782096
});
20792097
SetFlowNodeStatus({
20802098
fill: 'yellow',

0 commit comments

Comments
 (0)