node-red-contrib-boolean-logic-ultimate 1.1.2 → 1.1.3

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
@@ -3,6 +3,10 @@
3
3
 
4
4
  # CHANGELOG
5
5
 
6
+ <p>
7
+ <b>Version 1.1.3</b> March 2024<br/>
8
+ - Comparator node: NEW: you can now reset both input values to *undefined*, by sending **msg.reset = true**.</br>
9
+ </p>
6
10
  <p>
7
11
  <b>Version 1.1.2</b> January 2024<br/>
8
12
  - NEW: added "normal" and "violated" as default accepted inputs, for compatibility with Home Assistant.</br>
package/README.md CHANGED
@@ -21,24 +21,9 @@ A set of Node-RED enhanced boolean logic and utility nodes, with persistent valu
21
21
  <br/>
22
22
  <br/>
23
23
 
24
- ### COMPATIBLES INPUT VALUES
25
- Other than true/false, all nodes accepts these strings and convert it to true/false. All nodes are compatible with Homeassistant output strings.
26
- |Input|Translated into|
27
- |--|--|
28
- | "on" | true |
29
- | "off" | false |
30
- | "active" | true |
31
- | "inactive" | false |
32
- | "open" | true |
33
- | "closed" or "close" | false |
34
- | "true" | true |
35
- | "false" | false |
36
- | "1" | true |
37
- | "0" | false |
38
- | "home" | true |
39
- | "not_home" | false |
40
-
41
- You can add your own translation command, thanks to the translator-config node.
24
+ ### HOME ASSISTANT COMPATIBLES INPUT VALUES
25
+ Other than true/false, all nodes accepts [Homeassistant](https://www.home-assistant.io) output strings.
26
+ You can **even add your own input translation word list**, thanks to the translator-config node.
42
27
 
43
28
  <br/>
44
29
  <br/>
@@ -66,10 +66,10 @@
66
66
  if (this.delayEvaluation === 0 || this.delayEvaluation === "0" || this.delayEvaluation === "" || this.delayEvaluation === undefined) {
67
67
  delayEvaluation = "";
68
68
  } else {
69
- delayEvaluation = "d(" + this.delayEvaluation + ")";
69
+ delayEvaluation = " (delay " + (this.delayEvaluation / 1000) + "s)";
70
70
  }
71
71
  if (typeof this.outputtriggeredby !== "undefined") trigger = this.outputtriggeredby === "all" ? "" : "t(" + this.triggertopic + ")";
72
- label = "Gate " + this.inputCount + filtered + delayEvaluation + trigger;
72
+ label = "Gate (" + this.inputCount + " input)" + filtered + delayEvaluation + trigger;
73
73
  if (this.name !== undefined && this.name.length > 0) {
74
74
  label += " (" + this.name + ")";
75
75
  }
@@ -17,7 +17,7 @@
17
17
  },
18
18
  topic2: {
19
19
  value: "", required: true
20
- }
20
+ }
21
21
  },
22
22
  inputs: 1,
23
23
  outputs: 1,
@@ -84,9 +84,13 @@
84
84
  | Comparator | It's the comparator. It compares the Topic 1 against the Topic 2. |
85
85
  | Topic 2 | It's the second topic to be evaluated against the first topic. |
86
86
 
87
- <br/>
88
87
 
89
- ### Outputs
88
+ ### Input
89
+
90
+ : reset (boolean) : `msg.reset = true` is used to reset both input values to ***undefined***. The node will execute only the *reset* command, regardless of other message properties.
91
+
92
+
93
+ ### Output
90
94
 
91
95
  1. Standard output
92
96
  : payload (boolean) : the standard output of the command.
@@ -6,7 +6,7 @@ module.exports = function (RED) {
6
6
  node.math = config.math === undefined ? "===" : config.math;
7
7
  node.topic1Value = undefined;
8
8
  node.topic2Value = undefined;
9
-
9
+
10
10
  function setNodeStatus({ fill, shape, text }) {
11
11
  let dDate = new Date();
12
12
  node.status({
@@ -41,6 +41,16 @@ module.exports = function (RED) {
41
41
  }
42
42
 
43
43
  node.on("input", function (msg) {
44
+ if (msg.hasOwnProperty("reset")) {
45
+ node.topic1Value = undefined;
46
+ node.topic2Value = undefined;
47
+ setNodeStatus({
48
+ fill: "grey",
49
+ shape: "ring",
50
+ text: "Reset",
51
+ });
52
+ return;
53
+ }
44
54
  if (!msg.hasOwnProperty("topic")) {
45
55
  setNodeStatus({
46
56
  fill: "red",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-boolean-logic-ultimate",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "A set of Node-RED enhanced boolean logic and utility nodes, flow interruption, blinker, invert, filter, toggle etc.., with persistent values after reboot. Compatible also with Homeassistant values.",
5
5
  "author": "Supergiovane (https://github.com/Supergiovane)",
6
6
  "dependencies": {