node-red-contrib-boolean-logic-ultimate 1.1.25 → 1.1.26

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,15 +3,20 @@
3
3
 
4
4
  # CHANGELOG
5
5
 
6
+ <p>
7
+ <b>Version 1.1.26</b> July 2025<br/>
8
+ - Interruptflow node: fixed non functional msg.play. </br>
9
+ </p>
10
+
6
11
  <p>
7
12
  <b>Version 1.1.25</b> January 2025<br/>
8
- - BREAKING CHANGE
9
- - BREAKING CHANGE
10
- - BREAKING CHANGE
11
- - Numerical values are now evaluated as string values and translated like any other word in translation table. That means, 1 and numbers major than 1 are not equal to true anymore, and 0 is not equal to false anymore. If you inputs numerical values as boolean (bad attitude), please fix your flows by change it to boolean.</br>
12
- - BREAKING CHANGE
13
- - BREAKING CHANGE
14
- - BREAKING CHANGE
13
+ - BREAKING CHANGE<br/>
14
+ - BREAKING CHANGE<br/>
15
+ - BREAKING CHANGE<br/>
16
+ - Numerical values are now evaluated as string values and translated like any other word in translation table. That means, 1 and numbers major than 1 are not equal to true anymore, and 0 is not equal to false anymore. If you input numerical values as boolean (bad attitude), please fix your flows by change it to boolean.</br>
17
+ - BREAKING CHANGE<br/>
18
+ - BREAKING CHANGE<br/>
19
+ - BREAKING CHANGE<br/>
15
20
 
16
21
  </p>
17
22
  <p>
@@ -11,7 +11,7 @@ module.exports = function (RED) {
11
11
  ) || "trigger"; // Topic controlling the bInviaMessaggio
12
12
  node.bInviaMessaggio =
13
13
  node.config.initializewith === undefined ||
14
- node.config.initializewith === "1"
14
+ node.config.initializewith === "1"
15
15
  ? true
16
16
  : false; // Send the message or not
17
17
  node.autoToggle =
@@ -64,94 +64,95 @@ module.exports = function (RED) {
64
64
 
65
65
  this.on("input", function (msg) {
66
66
  var sIncomingTopic = "";
67
- if (msg.hasOwnProperty("topic")) {
68
- // 06/11/2019
69
- if (!msg.hasOwnProperty("topic") || msg.topic === undefined)
70
- msg.topic = "NoTopicReceived";
71
- sIncomingTopic = msg.topic.replace(
72
- /[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,
73
- ""
74
- ); // Cut unwanted Characters
75
- if (sIncomingTopic === node.sTriggerTopic) {
76
- const utils = require("./utils.js");
77
- let sPayload = utils.fetchFromObject(
78
- msg,
79
- config.payloadPropName || "payload"
80
- );
81
- // 15/11/2021 inform user about undefined topic or payload
82
- if (sPayload === undefined) {
83
- setNodeStatus({
84
- fill: "red",
85
- shape: "dot",
86
- text: "Received invalid payload from " + msg.topic || "",
87
- });
88
- return;
89
- }
90
- msg.payload = utils.ToBoolean(
91
- sPayload,
92
- RED.nodes.getNode(config.translatorConfig) // Retrieve the config node. It can be null, but it's handled in utils.js; // 15/11/2021 Convert input to boolean.
93
- );
94
- if (msg.payload === undefined) return null;
95
- if (node.timerAutoToggle !== null)
96
- // 28/01/2022 Stop autotoggle
97
- clearInterval(node.timerAutoToggle);
67
+ //if (msg.hasOwnProperty("topic")) {
68
+ // 06/11/2019
69
+ if (!msg.hasOwnProperty("topic") || msg.topic === undefined)
70
+ msg.topic = "NoTopicReceived";
71
+ sIncomingTopic = msg.topic.replace(
72
+ /[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi,
73
+ ""
74
+ ); // Cut unwanted Characters
75
+ if (sIncomingTopic === node.sTriggerTopic) {
76
+ const utils = require("./utils.js");
77
+ let sPayload = utils.fetchFromObject(
78
+ msg,
79
+ config.payloadPropName || "payload"
80
+ );
81
+ // 15/11/2021 inform user about undefined topic or payload
82
+ if (sPayload === undefined) {
83
+ setNodeStatus({
84
+ fill: "red",
85
+ shape: "dot",
86
+ text: "Received invalid payload from " + msg.topic || "",
87
+ });
88
+ return;
89
+ }
90
+ msg.payload = utils.ToBoolean(
91
+ sPayload,
92
+ RED.nodes.getNode(config.translatorConfig) // Retrieve the config node. It can be null, but it's handled in utils.js; // 15/11/2021 Convert input to boolean.
93
+ );
94
+ //if (msg.payload === undefined) return null;
95
+ if (node.timerAutoToggle !== null) {
96
+ // 28/01/2022 Stop autotoggle
97
+ clearInterval(node.timerAutoToggle);
98
+ }
98
99
 
99
- if (msg.hasOwnProperty("play")) {
100
- if (node.currentMsg.payload !== undefined) {
101
- node.currentMsg.isReplay = true;
102
- setNodeStatus({
103
- fill: "yellow",
104
- shape: "dot",
105
- text: "-> replay",
106
- });
107
- // Restore previous status
108
- let t = setTimeout(() => {
109
- if (node.bInviaMessaggio) {
110
- setNodeStatus({
111
- fill: "green",
112
- shape: "dot",
113
- text: "-> pass",
114
- });
115
- } else {
116
- setNodeStatus({
117
- fill: "red",
118
- shape: "dot",
119
- text: "|| stop (stored last msg)",
120
- });
121
- }
122
- }, 1000);
123
- node.send(node.currentMsg);
124
- } else {
125
- setNodeStatus({
126
- fill: "grey",
127
- shape: "dot",
128
- text: "Nothing to replay",
129
- });
130
- }
131
- return;
132
- } else if (msg.hasOwnProperty("reset")) {
133
- node.currentMsg = {};
100
+ if (msg.hasOwnProperty("play")) {
101
+ if (node.currentMsg.payload !== undefined) {
102
+ node.currentMsg.isReplay = true;
134
103
  setNodeStatus({
135
104
  fill: "yellow",
136
105
  shape: "dot",
137
- text: "Deleted stored msg",
106
+ text: "-> replay",
138
107
  });
139
- return;
140
- } else if (msg.payload === true) {
141
- node.bInviaMessaggio = true;
142
- setNodeStatus({ fill: "green", shape: "dot", text: "-> pass" });
143
- return;
144
- } else if (msg.payload === false) {
145
- node.bInviaMessaggio = false;
108
+ // Restore previous status
109
+ let t = setTimeout(() => {
110
+ if (node.bInviaMessaggio) {
111
+ setNodeStatus({
112
+ fill: "green",
113
+ shape: "dot",
114
+ text: "-> pass",
115
+ });
116
+ } else {
117
+ setNodeStatus({
118
+ fill: "red",
119
+ shape: "dot",
120
+ text: "|| stop (stored last msg)",
121
+ });
122
+ }
123
+ }, 1000);
124
+ node.send(node.currentMsg);
125
+ } else {
146
126
  setNodeStatus({
147
- fill: "red",
127
+ fill: "grey",
148
128
  shape: "dot",
149
- text: "|| stop (stored last msg)",
129
+ text: "Nothing to replay",
150
130
  });
151
- return;
152
131
  }
132
+ return;
133
+ } else if (msg.hasOwnProperty("reset")) {
134
+ node.currentMsg = {};
135
+ setNodeStatus({
136
+ fill: "yellow",
137
+ shape: "dot",
138
+ text: "Deleted stored msg",
139
+ });
140
+ return;
141
+ } else if (msg.payload === true) {
142
+ node.bInviaMessaggio = true;
143
+ setNodeStatus({ fill: "green", shape: "dot", text: "-> pass" });
144
+ return;
145
+ } else if (msg.payload === false) {
146
+ node.bInviaMessaggio = false;
147
+ setNodeStatus({
148
+ fill: "red",
149
+ shape: "dot",
150
+ text: "|| stop (stored last msg)",
151
+ });
152
+ return;
153
153
  }
154
154
  }
155
+ //}
155
156
  node.currentMsg = RED.util.cloneMessage(msg);
156
157
  if (node.bInviaMessaggio) {
157
158
  node.send(msg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-boolean-logic-ultimate",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
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": {