Skip to content

Commit

Permalink
Merge pull request #58 from zwave-js/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
marcus-j-davies authored May 29, 2021
2 parents b0a3f65 + 253a6ca commit 17b7c8d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# node-red-contrib-zwave-js Change Log

- 3.7.0
- Added **ToggleRF** method to the **Controller** class
- Added **SetRFRegion** and **GetRFRegion** methods to the **Controller** class
- Bumped Z-Wave JS to 7.7.1
- Bumped Serial Ports to 9.1.0

- 3.6.0
- Added ability to Keep Nodes Awake using a controller method of **KeepNodeAwake**
- Added Keep Awake Status in **NODE_LIST**
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ Whatever your poison, the node will inject the following events, into your flow.
| VALUE_DB | "N/A" | A Structured Value DB object | Response to GetValueDB |
| NODE_NEIGHBORS | The source Node ID | Array of Node IDs | Response to GetNodeNeighbors |
| NODE_KEEP_AWAKE | The source Node ID | Bool : Keep Awake Status | Response to KeepNodeAwake |
| CURRENT_RF_REGION | "Controller" | The current RF Region | Response to GetRFRegion |
| RF_REGION_SET | "Controller" | The RF Region that was set | Response to SetRFRegion |
| RF_STATUS | "Controller" | The RF Status | Response to ToggleRF |
And such event(s) will look like this.
Expand Down Expand Up @@ -159,18 +162,21 @@ Some Association methods require an Object, these are detailed at the bottom.
| ------------------------- | ----------------------------------- | ----------------------------------------------------- |
| Controller | StartHealNetwork | |
| Controller | StopHealNetwork | |
| Controller | StartInclusion (see Notes) | [Include Non-Secure: Bool (optional)] |
| Controller | StartInclusion (See Notes) | [Include Non-Secure: Bool (optional)] |
| Controller | StopInclusion | |
| Controller | StartExclusion | |
| Controller | StopExclusion | |
| Controller | HardReset (see Notes) | |
| Controller | HardReset (See Notes) | |
| Controller | ProprietaryFunc (See Notes) | [Serial Function ID: Number, Data: Buffer] |
| Controller | InterviewNode | [Node ID: Number] |
| Controller | GetNodes | |
| Controller | SetNodeName | [Node ID: Number, Node Name: String] |
| Controller | SetNodeLocation | [Node ID: Number, Node Location: String] |
| Controller | GetNodeNeighbors | [Node ID: Number] |
| Controller | KeepNodeAwake | [Node ID: Number, Bool] |
| Controller | GetRFRegion (See Notes) | |
| Controller | SetRFRegion (See Notes) | [**RFRegion**: Enum] |
| Controller | ToggleRF | [Status: Bool] |
| Associations | GetAssociationGroups | [**AssociationAddress**: Object] |
| Associations | GetAllAssociationGroups | [Node ID: Number] |
| Associations | GetAssociations | [**AssociationAddress**: Object] |
Expand All @@ -193,6 +199,9 @@ let Message = {
return Message;
```

## Notes on Controller -> Set/Get RF Region
Support for these Commands, must be proivided by your stick.

## Notes on Controller -> StartInclusion
By default, the include process will only include secure devices, if you want to include non-secure devices, provide a **true** value

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "node-red-contrib-zwave-js",
"version": "3.6.0",
"version": "3.7.0",
"license": "MIT",
"description": "An extremely easy to use, zero dependency and feature rich Z-Wave node for Node Red, based on Z-Wave JS.",
"dependencies": {
"serialport": "9.0.8",
"zwave-js": "7.6.0",
"serialport": "9.1.0",
"zwave-js": "7.7.1",
"winston": "3.3.3"
},
"keywords": [
Expand Down
18 changes: 18 additions & 0 deletions zwave-js/zwave-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ module.exports = function (RED) {
KeypadMode:ZWaveJS.KeypadMode,
Weekday:ZWaveJS.Weekday,

// Controller Enums
RFRegion: ZWaveJS.RFRegion,

// node enums
InterviewStage: ZWaveJS.InterviewStage,
NodeStatus: ZWaveJS.NodeStatus,
Expand Down Expand Up @@ -685,6 +688,21 @@ module.exports = function (RED) {

switch (Operation) {

case "GetRFRegion":
let RFR = await Driver.controller.getRFRegion();
Send(ReturnController, "CURRENT_RF_REGION", Enums.RFRegion[RFR], send);
break;

case "SetRFRegion":
await Driver.controller.setRFRegion(Enums.RFRegion[Params[0]]);
Send(ReturnController, "RF_REGION_SET", Enums.RFRegion[RFR], send);
break;

case "ToggleRF":
await Driver.controller.toggleRF(Params[0]);
Send(ReturnController, "RF_STATUS", Params[0], send);
break;

case "GetNodes":
let Nodes = [];
Driver.controller.nodes.forEach((N, NI) => {
Expand Down

0 comments on commit 17b7c8d

Please sign in to comment.