node-red-contrib-boolean-logic-ultimate 1.1.7 → 1.1.9

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,14 @@
3
3
 
4
4
  # CHANGELOG
5
5
 
6
+ <p>
7
+ <b>Version 1.1.9</b> Mai 2024<br/>
8
+ - Added samples and better description of the Math's node (in particular, to the subract function).</br>
9
+ </p>
10
+ <p>
11
+ <b>Version 1.1.8</b> Mai 2024<br/>
12
+ - FIX Comparator node: fixed wrong results using minor and major comparator.</br>
13
+ </p>
6
14
  <p>
7
15
  <b>Version 1.1.7</b> April 2024<br/>
8
16
  - Math node: <b>BREAKING CHANGE</b>: in SUBTRACT mode, now you must set a msg.topic to start subtracting from.</br>
@@ -60,8 +60,8 @@
60
60
  <select type="text" id="node-input-math" placeholder="">
61
61
  <option value="===">=== (equals)</option>
62
62
  <option value="!==">!== (not equals)</option>
63
- <option value=">=">></option>
64
- <option value="<="><</option>
63
+ <option value=">">></option>
64
+ <option value="<"><</option>
65
65
  <option value=">=">>=</option>
66
66
  <option value="<="><=</option>
67
67
  </select>
@@ -66,7 +66,6 @@ module.exports = function (RED) {
66
66
  if (ret !== undefined) {
67
67
  ret = Number(ret);
68
68
 
69
- // Sum
70
69
  if (!isNaN(ret) && isFinite(ret)) {
71
70
  if (msg.topic === node.config.topic1) node.topic1Value = ret;
72
71
  if (msg.topic === node.config.topic2) node.topic2Value = ret;
@@ -63,7 +63,7 @@
63
63
  </div>
64
64
  <div class="form-row" id="divSubtractFirst" hidden>
65
65
  <label for="node-input-subtractstartfrom"><i class="icon-tag"></i> Subtract from</label>
66
- <input type="text" id="node-input-subtractstartfrom" placeholder="Type the msg.topic. See the help.">
66
+ <input type="text" id="node-input-subtractstartfrom" placeholder="See the help.">
67
67
  </div>
68
68
  </script>
69
69
 
@@ -74,9 +74,24 @@
74
74
  |--|--|
75
75
  | Input | It's the msg property to be evaluated. *By default, it is *payload*, but you can also specify other properties, for example "payload.value"* |
76
76
  | Operation | Operation to be performed. |
77
- | Subtract from | Only visible when the *operation* is **subtract**. The *msg.topic* indicating the start number for subtraction. This can be, for example, ***SolarPower***, indicating the power from wich you could subtract the house power consumption and obtain the power you sell to the grid. Remember, each inbound msg.topic to be subtracted must be different.|
77
+ | Subtract from | Only visible when the *operation* is **subtract**. It's the *msg.topic value* of the message containing the payload from wich the node starts subtracting. For example, if the incoming msg has ***msg.topic = 'startNumber'***, you must write only **startNumber** in the *Subtract from* field. |
78
78
 
79
79
  <br/>
80
+
81
+ ### Inputs
82
+
83
+ : reset (any) : by passing msg.reset, the node will reset all values and sarts from scratch.
84
+ : topic (string) : the topic identifying the incoming message. Each incoming msg, must have a different topic.
85
+ : payload (number) : the payload containing the number. If you've changed the incoming evaluation property in the ***Input*** field, the number to be evaluated must be put in such message's property, instead of the *payload* property.
86
+
87
+ ### Example of "subtract"
88
+
89
+ Copy this code and paste it in to your flow.
90
+
91
+ ```json
92
+ [{"id":"430cc033ed140940","type":"inject","z":"1050ddfb1ce105e8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"a","payload":"20","payloadType":"num","x":110,"y":140,"wires":[["97d95d92ddf4bf08"]]},{"id":"514067713f250a42","type":"inject","z":"1050ddfb1ce105e8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"startNumber","payload":"100","payloadType":"num","x":140,"y":100,"wires":[["97d95d92ddf4bf08"]]},{"id":"97d95d92ddf4bf08","type":"SumUltimate","z":"1050ddfb1ce105e8","name":"Subtract","property":"payload","math":"subtract","subtractstartfrom":"startNumber","x":320,"y":140,"wires":[["c55f332fe2dadc53"]]},{"id":"c55f332fe2dadc53","type":"debug","z":"1050ddfb1ce105e8","name":"Debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":470,"y":140,"wires":[]},{"id":"fe0ac0d4cd660a65","type":"inject","z":"1050ddfb1ce105e8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"b","payload":"10","payloadType":"num","x":110,"y":180,"wires":[["97d95d92ddf4bf08"]]},{"id":"3de15e77a932a0eb","type":"inject","z":"1050ddfb1ce105e8","name":"Reset","props":[{"p":"reset","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":110,"y":220,"wires":[["97d95d92ddf4bf08"]]}]
93
+ ```
94
+
80
95
  <br/>
81
96
 
82
97
  [SEE THE README FOR FULL HELP AND SAMPLES](https://github.com/Supergiovane/node-red-contrib-boolean-logic-ultimate)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-boolean-logic-ultimate",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
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": {