@mschaeffler/node-red-logic 1.4.4 → 1.4.5

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/counter.js CHANGED
@@ -16,6 +16,7 @@ module.exports = function(RED) {
16
16
  if( msg.reset || msg.topic==="init" )
17
17
  {
18
18
  msg.count = 0;
19
+ delete msg.reset;
19
20
  }
20
21
  else if( msg.query || msg.topic==="query" )
21
22
  {
package/logic_bool.js CHANGED
@@ -6,7 +6,7 @@ module.exports = function(RED) {
6
6
  //this.config = config;
7
7
  var node = this;
8
8
  this.property = config.property || "payload";
9
- this.showState = config.showState;
9
+ this.showState = Boolean( config.showState );
10
10
  this.filter = Boolean( config.filter );
11
11
  this.last = null;
12
12
 
package/logic_not.js CHANGED
@@ -6,7 +6,7 @@ module.exports = function(RED) {
6
6
  //this.config = config;
7
7
  var node = this;
8
8
  this.property = config.property || "payload";
9
- this.showState = config.showState;
9
+ this.showState = Boolean( config.showState );
10
10
  this.filter = Boolean( config.filter );
11
11
  this.last = null;
12
12
 
package/math_falling.js CHANGED
@@ -8,7 +8,7 @@ module.exports = function(RED) {
8
8
  this.property = config.property ?? "payload";
9
9
  this.propertyType = config.propertyType ?? "msg";
10
10
  this.threshold = config.threshold;
11
- this.showState = config.showState;
11
+ this.showState = Boolean( config.showState );
12
12
  if( this.propertyType === "jsonata" )
13
13
  {
14
14
  try {
@@ -71,7 +71,7 @@
71
71
 
72
72
  <script type="text/html" data-help-name="hysteresisEdge">
73
73
 
74
- <p>Message is only forwarded, if the payload raises above an upper limit or falls below a lower limit.</p>
74
+ <p>Message is only forwarded, if the payload rises above an upper limit or falls below a lower limit.</p>
75
75
  <p>Each <code>topic</code> is treated seperatly.</p>
76
76
  <p>If the msg property <code>invalid</code> is present in the message, all nodes ignore the message.</p>
77
77
 
@@ -96,7 +96,7 @@
96
96
  <dt>Property <span class="property-type">string</span></dt>
97
97
  <dd> defines the message property to be used as payload.</dd>
98
98
  <dt>up Threshold <span class="property-type">number</span></dt>
99
- <dd> threshold value for the raising edge detection.</dd>
99
+ <dd> threshold value for the rising edge detection.</dd>
100
100
  <dt>d(ow)n Threshold <span class="property-type">number</span></dt>
101
101
  <dd> threshold value for the falling edge detection.</dd>
102
102
  <dt>1st message <span class="property-type">string</span></dt>
@@ -5,12 +5,12 @@ module.exports = function(RED) {
5
5
  //this.config = config;
6
6
  var node = this;
7
7
  var context = this.context();
8
- this.property = config.property ?? "payload";
9
- this.propertyType = config.propertyType ?? "msg";
10
- this.threshold_raise = config.threshold_raise;
11
- this.threshold_fall = config.threshold_fall;
12
- this.initial = config.initial;
13
- this.showState = config.showState;
8
+ this.property = config.property ?? "payload";
9
+ this.propertyType = config.propertyType ?? "msg";
10
+ this.threshold_rise = config.threshold_raise;
11
+ this.threshold_fall = config.threshold_fall;
12
+ this.initial = config.initial ?? "none";
13
+ this.showState = Boolean( config.showState );
14
14
  if( this.propertyType === "jsonata" )
15
15
  {
16
16
  try {
@@ -76,7 +76,7 @@ module.exports = function(RED) {
76
76
 
77
77
  if( last )
78
78
  {
79
- if( msg.payload > node.threshold_raise && node.threshold_raise >= last.value && last.edge != 'rising')
79
+ if( msg.payload > node.threshold_rise && node.threshold_rise >= last.value && last.edge != 'rising')
80
80
  {
81
81
  sendMsg( 'rising' );
82
82
  }
@@ -88,7 +88,7 @@ module.exports = function(RED) {
88
88
  else
89
89
  {
90
90
  data[msg.topic] = {};
91
- if( ['any','rising'].includes(node.initial) && msg.payload > node.threshold_raise )
91
+ if( ['any','rising'].includes(node.initial) && msg.payload > node.threshold_rise )
92
92
  {
93
93
  sendMsg( 'rising' );
94
94
  }
@@ -13,12 +13,12 @@
13
13
  outputs:1,
14
14
  icon: "raising-edge.png",
15
15
  label: function() {
16
- return this.name||"raising edge";
16
+ return this.name||"rising edge";
17
17
  },
18
18
  labelStyle: function() {
19
19
  return this.name?"node_label_italic":"";
20
20
  },
21
- paletteLabel: "raising edge",
21
+ paletteLabel: "rising edge",
22
22
  inputLabels: 'input',
23
23
  outputLabels: 'edge trigger',
24
24
  oneditprepare: function() {
@@ -53,7 +53,7 @@
53
53
 
54
54
  <script type="text/html" data-help-name="raisingEdge">
55
55
 
56
- <p>Message is only forwarded, if the payload raises above a threshold value.</p>
56
+ <p>Message is only forwarded, if the payload rises above a threshold value.</p>
57
57
  <p>Each <code>topic</code> is treated seperatly.</p>
58
58
  <p>If the msg property <code>invalid</code> is present in the message, all nodes ignore the message.</p>
59
59
 
@@ -8,7 +8,7 @@ module.exports = function(RED) {
8
8
  this.property = config.property ?? "payload";
9
9
  this.propertyType = config.propertyType ?? "msg";
10
10
  this.threshold = config.threshold;
11
- this.showState = config.showState;
11
+ this.showState = Boolean( config.showState );
12
12
  if( this.propertyType === "jsonata" )
13
13
  {
14
14
  try {
@@ -67,7 +67,7 @@ module.exports = function(RED) {
67
67
  if( msg.payload > node.threshold && node.threshold >= last )
68
68
  {
69
69
  status.fill = "green";
70
- msg.edge = "raising";
70
+ msg.edge = "rising";
71
71
  send( msg );
72
72
  }
73
73
  data[msg.topic] = msg.payload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mschaeffler/node-red-logic",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "nodes for simple operations.",
5
5
  "license": "LGPL-2.1",
6
6
  "homepage": "https://github.com/m-schaeffler/node-red-my-nodes/tree/main/node-red-logic",
@@ -26,7 +26,7 @@
26
26
  "negate": "math_minus.js",
27
27
  "reduce": "math_reduce.js",
28
28
  "fallingEdge": "math_falling.js",
29
- "raisingEdge": "math_raising.js",
29
+ "raisingEdge": "math_rising.js",
30
30
  "hysteresisEdge": "math_hysteresis.js",
31
31
  "statistics": "math_statistics.js",
32
32
  "mean": "math_mean.js"