@mschaeffler/node-red-logic 3.14.1 → 4.0.0

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.
@@ -12,8 +12,6 @@
12
12
  const raise = $("#node-input-threshold_raise").length ? $("#node-input-threshold_raise").val() : this.threshold_raise;
13
13
  return v!=='' && !isNaN(v) && Number(v)<raise;}
14
14
  },
15
- consecutive:{value:1,required:true,validate:RED.validators.number()},
16
- consecutiveFall:{value:1,required:true,validate:RED.validators.number()},
17
15
  outputRise:{value:true,required:true},
18
16
  outputRiseType:{value:"bool"},
19
17
  outputFall:{value:false,required:true},
@@ -75,14 +73,6 @@
75
73
  <label for="node-input-threshold_fall"><i class="fa fa-chevron-down"></i> dn threshold</label>
76
74
  <input type="text" id="node-input-threshold_fall">
77
75
  </div>
78
- <div class="form-row">
79
- <label for="node-input-consecutive"><i class="fa fa-line-chart"></i> rise Consecutive</label>
80
- <input type="number" id="node-input-consecutive">
81
- </div>
82
- <div class="form-row">
83
- <label for="node-input-consecutiveFall"><i class="fa fa-line-chart"></i> fall Consecutive</label>
84
- <input type="number" id="node-input-consecutiveFall">
85
- </div>
86
76
  <div class="form-row">
87
77
  <label for="node-input-outputRise"><i class="fa fa-sign-out"></i> rise Output</label>
88
78
  <input type="text" id="node-input-outputRise">
@@ -150,10 +140,6 @@
150
140
  <dd> threshold value for the rising edge detection.</dd>
151
141
  <dt>d(ow)n Threshold <span class="property-type">number</span></dt>
152
142
  <dd> threshold value for the falling edge detection.</dd>
153
- <dt>rise Consecutive <span class="property-type">number</span></dt>
154
- <dd> number of consecutive frames to generate a rising output.</dd>
155
- <dt>fall Consecutive <span class="property-type">number</span></dt>
156
- <dd> number of consecutive frames to generate a falling output.</dd>
157
143
  <dt>rise Output <span class="property-type">multi</span></dt>
158
144
  <dd> Value to be sent in case of a rising edge.</dd>
159
145
  <dt>fall Output <span class="property-type">multi</span></dt>
@@ -11,8 +11,6 @@ module.exports = function(RED) {
11
11
  this.propertyType = config.propertyType ?? "msg";
12
12
  this.threshold_rise = Number( config.threshold_raise );
13
13
  this.threshold_fall = Number( config.threshold_fall );
14
- this.consecutiveRise= Number( config.consecutive ?? 1 );
15
- this.consecutiveFall= Number( config.consecutiveFall ?? 1 );
16
14
  this.outputRise = RED.util.evaluateNodeProperty( config.outputRise ?? "true", config.outputRiseType ?? "bool" );
17
15
  this.outputFall = RED.util.evaluateNodeProperty( config.outputFall ?? "false",config.outputFallType ?? "bool" );
18
16
  this.noInit = Boolean( config.noInit );
@@ -27,8 +25,6 @@ module.exports = function(RED) {
27
25
  return;
28
26
  }
29
27
  }
30
- node.cntRise = 0;
31
- node.cntFall = 0;
32
28
  node.status( "" );
33
29
 
34
30
  function msgSetEdge(msg,edge)
@@ -110,34 +106,11 @@ module.exports = function(RED) {
110
106
 
111
107
  if( msg.value > node.threshold_rise && last !== true )
112
108
  {
113
- if( ++node.cntRise >= node.consecutiveRise )
114
- {
115
- sendMsg( true );
116
- node.cntRise = 0;
117
- }
118
- else
119
- {
120
- status.fill = "gray";
121
- }
122
- node.cntFall = 0;
109
+ sendMsg( true );
123
110
  }
124
111
  else if( msg.value < node.threshold_fall && last !== false )
125
112
  {
126
- if( ++node.cntFall >= node.consecutiveFall )
127
- {
128
- sendMsg( false );
129
- node.cntFall = 0;
130
- }
131
- else
132
- {
133
- status.fill = "gray";
134
- }
135
- node.cntRise = 0;
136
- }
137
- else
138
- {
139
- node.cntRise = 0;
140
- node.cntFall = 0;
113
+ sendMsg( false );
141
114
  }
142
115
  }
143
116
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mschaeffler/node-red-logic",
3
- "version": "3.14.1",
3
+ "version": "4.0.0",
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",