Skip to content

Commit

Permalink
Bump driver to v14 (#292)
Browse files Browse the repository at this point in the history
* Boom!

* Patch out config update

* add external dir (re-add updates)

* Update CHANGELOG.md

* Update CHANGELOG.md
  • Loading branch information
marcus-j-davies authored Nov 17, 2024
1 parent 6206641 commit 66235a8
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 17 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# node-red-contrib-zwave-js Change Log

- 9.1.0

**Changes**
- Bump ZWave JS from v12 to V14 + other dependencies

**New Features**
- Added ability to set the base config directory.
Note: Installing configuration updates, now requires this to be utilised.
This not considered a breaking change, as it does not affect use.

- 9.0.4

**Maintenance Release**
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "node-red-contrib-zwave-js",
"version": "9.0.4",
"version": "9.1.0",
"license": "MIT",
"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.",
"dependencies": {
"limiter": "^2.1.0",
"lodash": "^4.17.21",
"winston": "^3.13.0",
"winston-transport": "^4.7.0",
"zwave-js": "^12.5.6"
"winston": "^3.17.0",
"winston-transport": "^4.9.0",
"zwave-js": "^14.3.3"
},
"devDependencies": {
"eslint": "^9.1.1",
"prettier": "^3.2.5"
"eslint": "^9.15.0",
"prettier": "^3.3.3"
},
"scripts": {
"validate": "node-red-dev validate -o validation_result.json"
Expand Down
7 changes: 6 additions & 1 deletion zwave-js/zwave-js.html
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,7 @@
sendUsageStatistics: { value: true },
valueCacheDiskThrottle: { value: 'normal' },
customConfigPath: { value: undefined },
baseConfigPath: { value: undefined },
intvwUserCodes: { value: false },
softResetUSB: { value: false },
outputs: { value: 1 },
Expand Down Expand Up @@ -1316,9 +1317,13 @@
<strong>Advanced Driver Settings</strong>
</p>
<div class="form-row">
<label for="node-input-customConfigPath" style="width:130px"><i class="fa fa-pencil"></i> Custom CFG Dir</label>
<label for="node-input-customConfigPath" style="width:130px"><i class="fa fa-pencil"></i> Priority CFG Dir</label>
<input type="text" id="node-input-customConfigPath" placeholder="/some/directory" style="width: calc(100% - 135px)">
</div>
<div class="form-row">
<label for="node-input-baseConfigPath" style="width:130px"><i class="fa fa-pencil"></i> Base CFG Dir</label>
<input type="text" id="node-input-baseConfigPath" placeholder="Use Default" style="width: calc(100% - 135px)">
</div>
<div class="form-row">
<label for="node-input-valueCacheDiskThrottle" style="width:130px"><i class="fa fa-pencil"></i> Disk IO Throttle</label>
<select id="node-input-valueCacheDiskThrottle" style="width: calc(100% - 135px)">
Expand Down
38 changes: 28 additions & 10 deletions zwave-js/zwave-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,16 +310,19 @@ module.exports = function (RED) {
DriverOptions.disableOptimisticValueUpdate = false;
}

DriverOptions.features = {};

// Soft Reset
if (config.softResetUSB !== undefined && config.softResetUSB) {
Log(
'debug',
'NDERED',
undefined,
'[options] [enableSoftReset]',
'[options] [features.softReset]',
'Enabled'
);
DriverOptions.enableSoftReset = true;

DriverOptions.features.softReset = true;

if (
config.serialAPIStarted !== undefined &&
Expand All @@ -342,10 +345,10 @@ module.exports = function (RED) {
'debug',
'NDERED',
undefined,
'[options] [enableSoftReset]',
'[options] [features.softReset]',
'Disabled'
);
DriverOptions.enableSoftReset = false;
DriverOptions.features.softReset = true;
}

DriverOptions.storage = {};
Expand Down Expand Up @@ -378,6 +381,20 @@ module.exports = function (RED) {
DriverOptions.storage.deviceConfigPriorityDir = config.customConfigPath;
}

if (
config.baseConfigPath !== undefined &&
config.baseConfigPath.length > 0
) {
Log(
'debug',
'NDERED',
undefined,
'[options] [storage.deviceConfigExternalDir]',
config.baseConfigPath
);
DriverOptions.storage.deviceConfigExternalDir = config.baseConfigPath;
}

// Disk throttle
if (
config.valueCacheDiskThrottle !== undefined &&
Expand Down Expand Up @@ -1166,9 +1183,9 @@ module.exports = function (RED) {
if (SupportsNN) {
await Driver.controller.nodes
.get(Params[0])
.commandClasses['Node Naming and Location'].setLocation(
Params[1]
);
.commandClasses[
'Node Naming and Location'
].setLocation(Params[1]);
}
ReturnNode.id = Params[0];
Send(ReturnNode, 'NODE_LOCATION_SET', Params[1], send);
Expand Down Expand Up @@ -1705,7 +1722,8 @@ module.exports = function (RED) {
NodeCheck(Params[0].nodeId);
Params[2].forEach((A) => {
if (
!Driver.controller.isAssociationAllowed(Params[0], Params[1], A)
Driver.controller.checkAssociation(Params[0], Params[1], A) !==
ZWaveJS.AssociationCheckResult.OK
) {
const ErrorMSG = `Association: Source -> ${JSON.stringify(
Params[0]
Expand Down Expand Up @@ -2072,9 +2090,9 @@ module.exports = function (RED) {
});

// Include
Driver.controller.on(event_InclusionStarted.zwaveName, (Secure) => {
Driver.controller.on(event_InclusionStarted.zwaveName, (strategy) => {
Send(undefined, event_InclusionStarted.redName, {
isSecureInclude: Secure
isSecureInclude: strategy !== ZWaveJS.InclusionStrategy.Insecure
});
SetFlowNodeStatus({
fill: 'yellow',
Expand Down

0 comments on commit 66235a8

Please sign in to comment.