@mschaeffler/node-red-logic 0.4.5 → 0.5.1
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/README.md +2 -0
- package/counter.html +2 -0
- package/counter.js +4 -0
- package/logic_and.html +1 -0
- package/logic_and.js +4 -0
- package/logic_bool.html +1 -0
- package/logic_bool.js +4 -1
- package/logic_or.html +1 -0
- package/logic_or.js +4 -0
- package/math_falling.html +1 -0
- package/math_falling.js +4 -0
- package/math_hysteresis.html +1 -0
- package/math_hysteresis.js +4 -0
- package/math_number.html +1 -0
- package/math_number.js +4 -1
- package/math_raising.html +1 -0
- package/math_raising.js +4 -0
- package/math_reduce.html +1 -0
- package/math_reduce.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ Nodes to perform boolean and arithmetic operations on input signals.
|
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
7
|
+
If the msg property `invalid` is present in the message, all nodes ignore the message.
|
|
8
|
+
|
|
7
9
|
## Install
|
|
8
10
|
|
|
9
11
|
```
|
package/counter.html
CHANGED
package/counter.js
CHANGED
package/logic_and.html
CHANGED
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
<p>.Combines two or more boolean vales with the <code>and</code> operator.</p>
|
|
54
54
|
<p>The input values are converted as described in the <code>to bool</code> node.</p>
|
|
55
|
+
<p>If the msg property <code>invalid</code> is present in the message, all nodes ignore the message.</p>
|
|
55
56
|
|
|
56
57
|
<h3>Input</h3>
|
|
57
58
|
|
package/logic_and.js
CHANGED
package/logic_bool.html
CHANGED
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
<script type="text/html" data-help-name="tobool">
|
|
46
46
|
|
|
47
47
|
<p>Converts payload to a bool value:</p>
|
|
48
|
+
<p>If the msg property <code>invalid</code> is present in the message, all nodes ignore the message.</p>
|
|
48
49
|
|
|
49
50
|
<table>
|
|
50
51
|
<tr> <th>type</th> <th>input</th> <th>output</th> </tr>
|
package/logic_bool.js
CHANGED
|
@@ -9,8 +9,11 @@ module.exports = function(RED) {
|
|
|
9
9
|
this.showState = config.showState;
|
|
10
10
|
|
|
11
11
|
node.on('input', function(msg,send,done) {
|
|
12
|
+
if( msg.invalid )
|
|
13
|
+
{
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
12
16
|
msg.payload = tools.property2boolean( RED.util.getMessageProperty( msg, node.property ) );
|
|
13
|
-
|
|
14
17
|
if( msg.payload !== null )
|
|
15
18
|
{
|
|
16
19
|
if( node.showState )
|
package/logic_or.html
CHANGED
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
<p>Combines two or more boolean vales with the <code>or</code> operator.</p>
|
|
54
54
|
<p>The input values are converted as described in the <code>to bool</code> node.</p>
|
|
55
|
+
<p>If the msg property <code>invalid</code> is present in the message, all nodes ignore the message.</p>
|
|
55
56
|
|
|
56
57
|
<h3>Input</h3>
|
|
57
58
|
|
package/logic_or.js
CHANGED
package/math_falling.html
CHANGED
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
<p>Message is only forwarded, if the payload falls below a threshold value.</p>
|
|
53
53
|
<p>Each <code>topic</code> is treated seperatly.</p>
|
|
54
|
+
<p>If the msg property <code>invalid</code> is present in the message, all nodes ignore the message.</p>
|
|
54
55
|
|
|
55
56
|
<h3>Input</h3>
|
|
56
57
|
|
package/math_falling.js
CHANGED
package/math_hysteresis.html
CHANGED
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
|
|
70
70
|
<p>Message is only forwarded, if the payload raises above an upper limit or falls below a lower limit.</p>
|
|
71
71
|
<p>Each <code>topic</code> is treated seperatly.</p>
|
|
72
|
+
<p>If the msg property <code>invalid</code> is present in the message, all nodes ignore the message.</p>
|
|
72
73
|
|
|
73
74
|
<h3>Input</h3>
|
|
74
75
|
|
package/math_hysteresis.js
CHANGED
package/math_number.html
CHANGED
package/math_number.js
CHANGED
|
@@ -8,8 +8,11 @@ module.exports = function(RED) {
|
|
|
8
8
|
this.showState = config.showState;
|
|
9
9
|
|
|
10
10
|
node.on('input', function(msg,send,done) {
|
|
11
|
+
if( msg.invalid )
|
|
12
|
+
{
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
11
15
|
msg.payload = Number( RED.util.getMessageProperty( msg, node.property ) );
|
|
12
|
-
|
|
13
16
|
if( ! isNaN( msg.payload ) )
|
|
14
17
|
{
|
|
15
18
|
if( node.showState )
|
package/math_raising.html
CHANGED
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
<p>Message is only forwarded, if the payload raises above a threshold value.</p>
|
|
53
53
|
<p>Each <code>topic</code> is treated seperatly.</p>
|
|
54
|
+
<p>If the msg property <code>invalid</code> is present in the message, all nodes ignore the message.</p>
|
|
54
55
|
|
|
55
56
|
<h3>Input</h3>
|
|
56
57
|
|
package/math_raising.js
CHANGED
package/math_reduce.html
CHANGED
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
|
|
102
102
|
<p>Combines two or more streams of data (topics) into one single value.</p>
|
|
103
103
|
<p>Each stream can be debounced by arithmatic mean.</p>
|
|
104
|
+
<p>If the msg property <code>invalid</code> is present in the message, all nodes ignore the message.</p>
|
|
104
105
|
|
|
105
106
|
<h3>Input</h3>
|
|
106
107
|
|
package/math_reduce.js
CHANGED
package/package.json
CHANGED