@bldgblocks/node-red-contrib-control 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ module.exports = function(RED) {
4
4
  const node = this;
5
5
 
6
6
  node.runtime = {
7
- name: config.name || "",
7
+ name: config.name,
8
8
  state: false,
9
9
  desired: false
10
10
  };
@@ -21,9 +21,13 @@ module.exports = function(RED) {
21
21
  );
22
22
  node.runtime.delayOff = (parseFloat(node.runtime.delayOff)) * (config.delayOffUnits === "seconds" ? 1000 : config.delayOffUnits === "minutes" ? 60000 : 1);
23
23
 
24
- node.period = parseFloat(node.period);
25
- if (isNaN(node.period) || node.period <= 0 || !isFinite(node.period)) {
26
- node.period = 1000;
24
+ if (isNaN(node.runtime.delayOn) || node.runtime.delayOn <= 0 || !isFinite(node.runtime.delayOn)) {
25
+ node.runtime.delayOn = 1000;
26
+ node.status({ fill: "yellow", shape: "ring", text: "invalid period, using 1000ms" });
27
+ }
28
+
29
+ if (isNaN(node.runtime.delayOff) || node.runtime.delayOff <= 0 || !isFinite(node.runtime.delayOff)) {
30
+ node.runtime.delayOff = 1000;
27
31
  node.status({ fill: "yellow", shape: "ring", text: "invalid period, using 1000ms" });
28
32
  }
29
33
  } catch(err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bldgblocks/node-red-contrib-control",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "Sedona-inspired control nodes for Node-RED",
5
5
  "keywords": [ "node-red", "sedona", "control", "hvac" ],
6
6
  "files": ["nodes/*.js", "nodes/*.html"],