simonbuttazzi / node-red-contrib-boolean-parser Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
exit codes from the exec
node should be treated as:
inverting the logic as with #1 is a decent workaround, but not sufficient because other inputs, true
, false
get inverted.
Probably the best way is to add a new input handler for payload.code: int
, but I'm not sure how difficult this would be compared to the node providing a new option for "invert int only" and having the user change input field to msg.payload.code
.
Below is an export of my test bed using the linux commands true
and false
:
[
{
"id": "71e415a7afce0d70",
"type": "exec",
"z": "ac5d738a04ab6a0e",
"command": "false",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 330,
"y": 200,
"wires": [
[],
[],
[
"cde9d7deeea061e0",
"4a4f07641695f8a5"
]
]
},
{
"id": "3d79b461ea9591df",
"type": "inject",
"z": "ac5d738a04ab6a0e",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 180,
"y": 200,
"wires": [
[
"71e415a7afce0d70"
]
]
},
{
"id": "f6b9d8d7079a563e",
"type": "exec",
"z": "ac5d738a04ab6a0e",
"command": "true",
"addpay": "",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "",
"x": 330,
"y": 140,
"wires": [
[],
[],
[
"cde9d7deeea061e0",
"03d8abafb3074b97"
]
]
},
{
"id": "900fdde1e9cd8f1e",
"type": "inject",
"z": "ac5d738a04ab6a0e",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 180,
"y": 140,
"wires": [
[
"f6b9d8d7079a563e"
]
]
},
{
"id": "cde9d7deeea061e0",
"type": "bool",
"z": "ac5d738a04ab6a0e",
"name": "bool(exitcode)",
"outputs": 3,
"inputField": "payload.code",
"outputField": "payload",
"outputFormat": "bool",
"handleNull": "null",
"invert": false,
"strict": false,
"x": 540,
"y": 340,
"wires": [
[
"03d8abafb3074b97"
],
[
"4a4f07641695f8a5"
],
[
"333c9fddd0fdb27f"
]
]
},
{
"id": "03d8abafb3074b97",
"type": "debug",
"z": "ac5d738a04ab6a0e",
"name": "should be true",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 900,
"y": 300,
"wires": []
},
{
"id": "4a4f07641695f8a5",
"type": "debug",
"z": "ac5d738a04ab6a0e",
"name": "should be false",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 900,
"y": 360,
"wires": []
},
{
"id": "333c9fddd0fdb27f",
"type": "debug",
"z": "ac5d738a04ab6a0e",
"name": "should be null",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 900,
"y": 420,
"wires": []
},
{
"id": "8a13cf28e2beb15b",
"type": "inject",
"z": "ac5d738a04ab6a0e",
"name": "msg.payload.code: true",
"props": [
{
"p": "payload.code",
"v": "true",
"vt": "bool"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 280,
"y": 520,
"wires": [
[
"cde9d7deeea061e0",
"03d8abafb3074b97"
]
]
},
{
"id": "41f8fe160b55901a",
"type": "inject",
"z": "ac5d738a04ab6a0e",
"name": "msg.payload.code: null",
"props": [],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 300,
"y": 640,
"wires": [
[
"cde9d7deeea061e0",
"333c9fddd0fdb27f"
]
]
},
{
"id": "183b09e92ebd3b81",
"type": "inject",
"z": "ac5d738a04ab6a0e",
"name": "msg.payload.code: false",
"props": [
{
"p": "payload.code",
"v": "false",
"vt": "bool"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 290,
"y": 580,
"wires": [
[
"cde9d7deeea061e0",
"4a4f07641695f8a5"
]
]
}
]
Great node - love it - has enabled me to clean up flows big time.
Found a little typo:
"... cant't ..." should be "... can't ..."
node-red-contrib-boolean-parser/README.md
Line 75 in 74bb727
A node can be configured to invert boolean logic:
Input true leads to an output false.
Show boolean status of last message as node status:
Hi on my Node red I am not able to install the boolean parser:
2024-03-26T08:29:28.052Z Installieren : node-red-contrib-boolean-logic 0.0.3
2024-03-26T08:29:28.029Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2024-03-26T08:29:32.676Z Installieren : node-red-contrib-boolean-parser 1.4.6
2024-03-26T08:29:38.266Z [out] + [email protected]
2024-03-26T08:29:38.266Z [out] added 1 package from 1 contributor in 6.602s
2024-03-26T08:29:38.357Z rc=0
2024-03-26T08:29:38.590Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2024-03-26T08:29:50.382Z [out] + [email protected]
2024-03-26T08:29:50.382Z [out] added 1 package from 1 contributor in 8.175s
2024-03-26T08:29:50.455Z rc=0
2024-03-26T08:30:28.285Z Installieren : node-red-contrib-boolean-parser 1.4.6
2024-03-26T08:30:28.255Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2024-03-26T08:30:37.204Z [out] + [email protected]
2024-03-26T08:30:37.204Z [out] updated 1 package in 5.419s
2024-03-26T08:30:37.289Z rc=0
2024-03-26T08:37:36.494Z Installieren : node-red-contrib-boolean-parser 1.4.6
2024-03-26T08:37:36.464Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2024-03-26T08:37:46.790Z [out] + [email protected]
2024-03-26T08:37:46.790Z [out] updated 1 package in 6.739s
2024-03-26T08:37:46.876Z rc=0
what could be the problem?
thanks in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.