node-red-contrib-boolean-logic-ultimate 1.0.54 → 1.0.55
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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# CHANGELOG
|
|
5
5
|
|
|
6
6
|
<p>
|
|
7
|
-
<b>Version 1.0.
|
|
7
|
+
<b>Version 1.0.55</b> July 2022<br/>
|
|
8
8
|
- NEW: you can now specify the input property name from witch the node picks up the payload.</br>
|
|
9
9
|
- NEW: added more Homeassistant string compatibility values.</br>
|
|
10
10
|
- Updated the README</br>
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
defaults: {
|
|
6
6
|
name: {
|
|
7
7
|
value: "Invert"
|
|
8
|
-
}
|
|
8
|
+
},
|
|
9
|
+
payloadPropName: { value: "payload", required: false }
|
|
9
10
|
},
|
|
10
11
|
inputs:1,
|
|
11
12
|
outputs:1,
|
|
@@ -16,6 +17,10 @@
|
|
|
16
17
|
},
|
|
17
18
|
paletteLabel: function() {
|
|
18
19
|
return "InvertUltimate";
|
|
20
|
+
},
|
|
21
|
+
oneditprepare: function () {
|
|
22
|
+
if ($("#node-input-payloadPropName").val() === "") $("#node-input-payloadPropName").val("payload");
|
|
23
|
+
$("#node-input-payloadPropName").typedInput({ default: 'msg', types: ['msg'] });
|
|
19
24
|
}
|
|
20
25
|
});
|
|
21
26
|
</script>
|
|
@@ -31,6 +36,10 @@
|
|
|
31
36
|
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
|
32
37
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
33
38
|
</div>
|
|
39
|
+
<div class="form-row">
|
|
40
|
+
<label for="node-input-payloadPropName"><i class="fa fa-ellipsis-h"></i> Input</label>
|
|
41
|
+
<input type="text" id="node-input-payloadPropName">
|
|
42
|
+
</div>
|
|
34
43
|
</script>
|
|
35
44
|
|
|
36
45
|
<script type="text/x-red" data-help-name="InvertUltimate">
|
|
@@ -15,22 +15,23 @@ module.exports = function (RED) {
|
|
|
15
15
|
this.on('input', function (msg) {
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
// 11/11/2021 Clone input message and replace only relevant topics
|
|
19
|
+
const utils = require("./utils.js");
|
|
20
|
+
let sPayload = utils.fetchFromObject(msg, config.payloadPropName || "payload");
|
|
21
|
+
|
|
18
22
|
// 15/11/2021 inform user about undefined topic or payload
|
|
19
|
-
if (
|
|
23
|
+
if (sPayload === undefined ) {
|
|
20
24
|
setNodeStatus({ fill: "red", shape: "dot", text: "Received invalid payload from " + msg.topic || "" });
|
|
21
25
|
return;
|
|
22
26
|
}
|
|
23
27
|
|
|
24
|
-
|
|
25
|
-
// 11/11/2021 Clone input message and replace only relevant topics
|
|
26
|
-
const utils = require("./utils.js");
|
|
27
28
|
var bRes = null;
|
|
28
29
|
try {
|
|
29
|
-
bRes = utils.ToBoolean(
|
|
30
|
+
bRes = utils.ToBoolean(sPayload);
|
|
30
31
|
} catch (error) {
|
|
31
32
|
}
|
|
32
33
|
if (bRes === undefined || bRes === null) {
|
|
33
|
-
setNodeStatus({ fill: "red", shape: "dot", text: "Received non convertible boolean value " +
|
|
34
|
+
setNodeStatus({ fill: "red", shape: "dot", text: "Received non convertible boolean value " + sPayload + " from " + msg.topic });
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-boolean-logic-ultimate",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.55",
|
|
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": {
|