node-red-contrib-boolean-logic-ultimate 1.0.40 → 1.0.41

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.
package/CHANGELOG.md CHANGED
@@ -2,7 +2,11 @@
2
2
  [![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square)](https://www.paypal.me/techtoday)
3
3
 
4
4
  <p>
5
- <b>Version 1.0.40</b> Januart 2022<br/>
5
+ <b>Version 1.0.41</b> January 2022<br/>
6
+ - Boolean Logic Ultimate: UI optimization and remove warning triangle if the delay is not set.</br>
7
+ </p>
8
+ <p>
9
+ <b>Version 1.0.40</b> January 2022<br/>
6
10
  - NEW: Boolean Logic Ultimate: Delay option added. See the readme on gitHub.</br>
7
11
  </p>
8
12
  <p>
package/README.md CHANGED
@@ -94,7 +94,7 @@ Every time you modify the node's config, <b>the retained values are cleared</b>.
94
94
 
95
95
  If checked, the node will accept only boolean true/false values. Otherwise, it will try to convert the payload to a logic value true/false (including "on" and "off" values, sent, for example, from HomeAssistant).<br/>
96
96
 
97
- **Delay evaluation (msec)**
97
+ **Delay evaluation (ms)**
98
98
 
99
99
  Delays the evaluation until this time (in milliseconds) is elapsed. Each time a message or "topic trigger message" (see **Trigger mode**) arrives, the delay is restarted.<br/>
100
100
  This option is useful for debouncing pourposes or simply for adding some delay.<br/>
@@ -35,11 +35,7 @@
35
35
  },
36
36
  restrictinputevaluation: { value: true },
37
37
  delayEvaluation: {
38
- value: 0,
39
- validate:
40
- function (v) {
41
- return !isNaN(parseInt(v)) && parseInt(v) >= 0;
42
- }
38
+ value: 0
43
39
  }
44
40
  },
45
41
  inputs: 1,
@@ -124,7 +120,7 @@
124
120
 
125
121
  <div class="form-row">
126
122
  <label for="node-input-inputCount"><i class="fa fa-step-forward"></i> Inputs count</label>
127
- <input type="text" id="node-input-inputCount" placeholder="Inputs count, for example: 2">
123
+ <input style="width:100px" type="text" id="node-input-inputCount" placeholder="Inputs count, for example: 2">
128
124
  </div>
129
125
  <div class="form-tips" style="margin-top: 8px;background-color:lightgrey;text-align:center">Option above: the node waits for this number of <i>different</i> msg topics before evaluating the outputs.</div>
130
126
  <br/>
@@ -173,8 +169,8 @@
173
169
  &nbsp<label style="width:auto" for="node-input-restrictinputevaluation"> Reject non boolean (true/false) input values</label>
174
170
  </div>
175
171
  <div class="form-row">
176
- <label for="node-input-delayEvaluation"><i class="fa fa-hourglass-o"></i> Delay evaluation (msec)</label>
177
- <input style="width:100px" type="text" id="node-input-delayEvaluation" placeholder="0">
172
+ <label style="width:160px" for="node-input-delayEvaluation"><i class="fa fa-hourglass-o"></i> Delay evaluation (ms)</label>
173
+ <input style="width:150px" type="text" id="node-input-delayEvaluation" placeholder="Set 0 for no delay">
178
174
  </div>
179
175
 
180
176
  <br/>
@@ -11,6 +11,8 @@ module.exports = function (RED) {
11
11
  node.persistPath = path.join(RED.settings.userDir, "booleanlogicultimatepersist"); // 26/10/2020 Contains the path for the states dir.
12
12
  node.restrictinputevaluation = config.restrictinputevaluation === undefined ? false : config.restrictinputevaluation;
13
13
  node.delayEvaluation = config.delayEvaluation === undefined ? 0 : config.delayEvaluation; // 26/01/2022 Starts evaluating the inputs only after this amount of time is elapsed, after the last msg input or trigger
14
+ if (isNaN(parseInt(node.delayEvaluation)) || parseInt(node.delayEvaluation) < 0) node.delayEvaluation = 0;
15
+ if (typeof node.delayEvaluation === "string") node.delayEvaluation = parseInt(node.delayEvaluation);
14
16
  node.timerDelayEvaluation = null;
15
17
  node.inputMessage = {}; // 26/01/2022 input message is stored here.
16
18
 
@@ -164,8 +166,8 @@ module.exports = function (RED) {
164
166
  node.startTimerDelayEvaluation();
165
167
  setNodeStatus({ fill: "blue", shape: "ring", text: "Delay Eval " + node.delayEvaluation + "ms" });
166
168
  } else {
167
- outputResult();
168
- }
169
+ outputResult();
170
+ }
169
171
  } else {
170
172
  setNodeStatus({ fill: "grey", shape: "ring", text: "Saved (" + (msg.hasOwnProperty("topic") ? msg.topic : "empty input topic") + ") " + value });
171
173
  }
@@ -174,8 +176,8 @@ module.exports = function (RED) {
174
176
  node.startTimerDelayEvaluation();
175
177
  setNodeStatus({ fill: "blue", shape: "ring", text: "Delay Eval " + node.delayEvaluation + "ms" });
176
178
  } else {
177
- outputResult();
178
- }
179
+ outputResult();
180
+ }
179
181
  }
180
182
  }
181
183
  else if (keyCount > node.config.inputCount) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-boolean-logic-ultimate",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "A set of Node-RED enhanced boolean logic node, flow interruption node, blinker node, invert node, filter node, with persisten values after reboot and more.",
5
5
  "author": "Supergiovane (https://github.com/Supergiovane)",
6
6
  "dependencies": {