@mschaeffler/node-red-logic 3.5.0 → 3.6.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.
@@ -17,6 +17,7 @@
17
17
  outputRiseType:{value:"bool"},
18
18
  outputFall:{value:false,required:true},
19
19
  outputFallType:{value:"bool"},
20
+ noInit:{value:false},
20
21
  showState:{value:false}
21
22
  },
22
23
  inputs:1,
@@ -87,6 +88,10 @@
87
88
  <input type="text" id="node-input-outputFall">
88
89
  <input type="hidden" id="node-input-outputFallType">
89
90
  </div>
91
+ <div class="form-row">
92
+ <label for="node-input-noInit"><i class="fa fa-play"></i> no inits</label>
93
+ <input type="checkbox" id="node-input-noInit" style="display:inline-block; width:20px; vertical-align:baseline;">
94
+ </div>
90
95
  <div class="form-row">
91
96
  <label for="node-input-showStatus"><i class="fa fa-star-o"></i> Status</label>
92
97
  <input type="checkbox" id="node-input-showState" style="display:inline-block; width:20px; vertical-align:baseline;">
@@ -146,6 +151,8 @@
146
151
  <dd> Value to be sent in case of a rising edge.</dd>
147
152
  <dt>fall Output <span class="property-type">multi</span></dt>
148
153
  <dd> Value to be sent in case of a falling edge.</dd>
154
+ <dt>no init <span class="property-type">boolean</span></dt>
155
+ <dd> does not send init messages.</dd>
149
156
  <dt>Status <span class="property-type">boolean</span></dt>
150
157
  <dd> shows the actual value as a node status.</dd>
151
158
  </dl>
@@ -14,6 +14,7 @@ module.exports = function(RED) {
14
14
  this.consecutiveFall= Number( config.consecutiveFall ?? 1 );
15
15
  this.outputRise = tools.convertTypedInput( config.outputRise ?? "true", config.outputRiseType ?? "bool" );
16
16
  this.outputFall = tools.convertTypedInput( config.outputFall ?? "false",config.outputFallType ?? "bool" );
17
+ this.noInit = Boolean( config.noInit );
17
18
  this.showState = Boolean( config.showState );
18
19
  if( this.propertyType === "jsonata" )
19
20
  {
@@ -94,9 +95,12 @@ module.exports = function(RED) {
94
95
  status.fill = edge ? "red" : "blue";
95
96
  data[msg.topic] = { edge:edge, status:status.fill };
96
97
  context.set( "data", data );
97
- msgSetEdge( msg, edge );
98
- msg.init = last === undefined;
99
- send( msg );
98
+ if( last !== undefined || ! node.noInit )
99
+ {
100
+ msgSetEdge( msg, edge );
101
+ msg.init = last === undefined;
102
+ send( msg );
103
+ }
100
104
  }
101
105
 
102
106
  if( msg.value > node.threshold_rise && last !== true )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mschaeffler/node-red-logic",
3
- "version": "3.5.0",
3
+ "version": "3.6.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",