Skip to content

Commit

Permalink
Some Fixes (#208)
Browse files Browse the repository at this point in the history
* Some Fixes

* Update cmd-factory.html
  • Loading branch information
marcus-j-davies committed May 8, 2022
1 parent 9863a85 commit 43a6811
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 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

- 7.0.2

**Fixes**
- Fix **networkId** format
- Address LGTM alert

- 7.0.1

**Changes**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-zwave-js",
"version": "7.0.1",
"version": "7.0.2",
"license": "MIT",
"description": "An extremely powerful, easy to use, and feature rich Z-Wave node for Node Red, based on Z-Wave JS.",
"dependencies": {
Expand Down
16 changes: 4 additions & 12 deletions zwave-js/cmd-factory.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,10 @@

function GoToInfo() {
event.preventDefault();

const URL =
'https://zwave-js.github.io/node-zwave-js/#/api/CCs/' +
$('#node-input-cc').val().replace(/ /g, '') +
'?id=' +
$('#node-input-method').val().toLowerCase();
var link = document.createElement('a');
link.href = URL;
link.setAttribute('target', '_blank');
document.body.appendChild(link);
link.click();
link.remove();
const CC = $('#node-input-cc').val().replace(/ /g, '');
const Method = $('#node-input-method').val().toLowerCase();
const URL = `https://zwave-js.github.io/node-zwave-js/#/api/CCs/${CC}?id=${Method}`;
window.open(URL, '_blank');
}

function SortUI() {
Expand Down
2 changes: 1 addition & 1 deletion zwave-js/ui/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class UIServer {
this._RED = RED;
this._SmartStartCallback = this._SmartStartCallback.bind(this);

this._NetworkIdentifier = parseInt(ID);
this._NetworkIdentifier = ID;

AvailableNIDs = AvailableNIDs.filter(
(_ID) => _ID !== this._NetworkIdentifier
Expand Down
2 changes: 1 addition & 1 deletion zwave-js/zwave-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = function (RED) {
RED.nodes.createNode(this, config);
const RedNode = this;

const NetworkIdentifier = config.networkIdentifier || 1;
const NetworkIdentifier = parseInt(config.networkIdentifier || 1);

function SetFlowNodeStatus(Status) {
Status.text = `[Net: ${NetworkIdentifier}] ${Status.text}`;
Expand Down
2 changes: 1 addition & 1 deletion zwave-js/zwave-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports = function (RED) {
RED.nodes.createNode(this, config);
const RedNode = this;

const NetworkIdentifier = config.networkIdentifier || 1;
const NetworkIdentifier = parseInt(config.networkIdentifier || 1);
let UI = new UIServer(RED, NetworkIdentifier);
let Driver;
let Logger;
Expand Down

0 comments on commit 43a6811

Please sign in to comment.