node-red-contrib-boolean-logic-ultimate 1.1.25 → 1.1.27
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,23 @@
|
|
|
3
3
|
|
|
4
4
|
# CHANGELOG
|
|
5
5
|
|
|
6
|
+
<p>
|
|
7
|
+
<b>Version 1.1.27</b> July 2025<br/>
|
|
8
|
+
- Status node: UI correction. </br>
|
|
9
|
+
</p>
|
|
10
|
+
<p>
|
|
11
|
+
<b>Version 1.1.26</b> July 2025<br/>
|
|
12
|
+
- Interruptflow node: fixed non functional msg.play. </br>
|
|
13
|
+
</p>
|
|
6
14
|
<p>
|
|
7
15
|
<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
|
|
12
|
-
- BREAKING CHANGE
|
|
13
|
-
- BREAKING CHANGE
|
|
14
|
-
- BREAKING CHANGE
|
|
16
|
+
- BREAKING CHANGE<br/>
|
|
17
|
+
- BREAKING CHANGE<br/>
|
|
18
|
+
- BREAKING CHANGE<br/>
|
|
19
|
+
- 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>
|
|
20
|
+
- BREAKING CHANGE<br/>
|
|
21
|
+
- BREAKING CHANGE<br/>
|
|
22
|
+
- BREAKING CHANGE<br/>
|
|
15
23
|
|
|
16
24
|
</p>
|
|
17
25
|
<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
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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: "
|
|
106
|
+
text: "-> replay",
|
|
138
107
|
});
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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: "
|
|
127
|
+
fill: "grey",
|
|
148
128
|
shape: "dot",
|
|
149
|
-
text: "
|
|
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);
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
},
|
|
21
21
|
paletteLabel: function () {
|
|
22
22
|
return "Status";
|
|
23
|
+
},
|
|
24
|
+
oneditprepare: function () {
|
|
25
|
+
if ($("#node-input-property").val() === "") $("#node-input-property").val("payload");
|
|
26
|
+
$("#node-input-property").typedInput({ default: 'msg', types: ['msg'] });
|
|
23
27
|
}
|
|
24
28
|
});
|
|
25
29
|
</script>
|
|
@@ -36,7 +40,7 @@
|
|
|
36
40
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
37
41
|
</div>
|
|
38
42
|
<div class="form-row">
|
|
39
|
-
<label for="node-input-property"><i class="
|
|
43
|
+
<label for="node-input-property"><i class="fa fa-ellipsis-h"></i> Show</label>
|
|
40
44
|
<input type="text" id="node-input-property" placeholder="payload">
|
|
41
45
|
</div>
|
|
42
46
|
</script>
|
|
@@ -27,17 +27,17 @@ module.exports = function (RED) {
|
|
|
27
27
|
|
|
28
28
|
this.on('input', function (msg) {
|
|
29
29
|
try {
|
|
30
|
+
node.send(msg);
|
|
30
31
|
let props = [] = this.config.property.split(".");
|
|
31
32
|
let ret = fetchFromObject(msg, this.config.property);
|
|
32
33
|
if (ret !== undefined) {
|
|
33
34
|
setNodeStatus({ fill: "green", shape: "ring", text: ret.toString() });
|
|
34
35
|
} else {
|
|
35
|
-
setNodeStatus({ fill: "red", shape: "ring", text: this.config.property + " is undefined."});
|
|
36
|
+
setNodeStatus({ fill: "red", shape: "ring", text: this.config.property + " is undefined." });
|
|
36
37
|
}
|
|
37
38
|
} catch (error) {
|
|
38
|
-
|
|
39
|
+
setNodeStatus({ fill: "red", shape: "ring", text: error.message });
|
|
39
40
|
}
|
|
40
|
-
node.send(msg);
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-boolean-logic-ultimate",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.27",
|
|
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": {
|