node-red-contrib-deconz
Advanced tools
Comparing version 2.0.7 to 2.0.8
@@ -10,2 +10,12 @@ # Changelog | ||
## [2.0.8] - 2021-10-22 ![Relative date](https://img.shields.io/date/1634857494?label=) | ||
### Added | ||
- Backward compatibility for Node-Red 1.2.9. | ||
### Fixed | ||
- Migration of device when undefined. | ||
## [2.0.7] - 2021-10-17 ![Relative date](https://img.shields.io/date/1634484549?label=) | ||
@@ -12,0 +22,0 @@ |
@@ -8,2 +8,3 @@ const NODE_PATH = '/node-red-contrib-deconz/'; | ||
const Utils = require("./src/runtime/Utils"); | ||
const CompareVersion = require('compare-versions'); | ||
@@ -13,2 +14,20 @@ module.exports = function (RED) { | ||
/** | ||
* Static files route because some users are using Node-Red 1.3.0 or lower | ||
*/ | ||
if (RED.version === undefined || CompareVersion.compare(RED.version(), '1.3.0', '<')) { | ||
RED.httpAdmin.get('/resources' + NODE_PATH + '*', function (req, res) { | ||
try { | ||
let options = { | ||
root: __dirname + '/resources', | ||
dotfiles: 'deny' | ||
}; | ||
res.sendFile(req.params[0], options); | ||
} catch (e) { | ||
console.error(e); | ||
res.status(500).end(); | ||
} | ||
}); | ||
} | ||
/** | ||
* Enable http route to multiple-select static files | ||
@@ -15,0 +34,0 @@ */ |
{ | ||
"name": "node-red-contrib-deconz", | ||
"version": "2.0.7", | ||
"version": "2.0.8", | ||
"description": "deCONZ connectivity nodes for node-red", | ||
@@ -66,2 +66,3 @@ "keywords": [ | ||
"node-red": { | ||
"version": ">=1.2.9", | ||
"nodes": { | ||
@@ -68,0 +69,0 @@ "api": "deconz.js", |
@@ -18,3 +18,3 @@ # Node-Red deCONZ | ||
This new version requires Node-Red version 2.0 or newer. | ||
__This new version requires Node-Red version 1.2.9 or newer.__ | ||
@@ -21,0 +21,0 @@ Some new features ([Changelog](https://github.com/deconz-community/node-red-contrib-deconz/blob/master/CHANGELOG.md)): |
@@ -49,3 +49,7 @@ const ConfigMigrationHandler = require('./ConfigMigrationHandler'); | ||
command.type = 'deconz_state'; | ||
if (this.config.device.substr(0, 6) === 'group_') { | ||
if (typeof this.config.device === 'string' && | ||
this.config.device !== 'undefined' && | ||
this.config.device.length > 0 && | ||
this.config.device.substr(0, 6) === 'group_' | ||
) { | ||
command.domain = 'groups'; | ||
@@ -213,10 +217,12 @@ } else if (Utils.isDeviceCover(device)) { | ||
// Strip 'group_' from device name | ||
let part = this.config.device.substring(6); | ||
if (part.length === 0 || isNaN(parseInt(part))) { | ||
this.result.errors.push(`Invalid group ID '${this.config.device}' for calling scene`); | ||
} else { | ||
command.arg.group = { | ||
type: 'num', | ||
value: String(part) | ||
}; | ||
if (typeof this.config.device === 'string' && this.config.device !== 'undefined' && this.config.device.length > 0) { | ||
let part = this.config.device.substring(6); | ||
if (part.length === 0 || isNaN(parseInt(part))) { | ||
this.result.errors.push(`Invalid group ID '${this.config.device}' for calling scene`); | ||
} else { | ||
command.arg.group = { | ||
type: 'num', | ||
value: String(part) | ||
}; | ||
} | ||
} | ||
@@ -223,0 +229,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
465893
6163