Code Monkey home page Code Monkey logo

node-red-contrib-boolean-parser's People

Contributors

simonbuttazzi avatar yamlcase avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

yamlcase

node-red-contrib-boolean-parser's Issues

support for exit code (different from invert logic)

exit codes from the exec node should be treated as:

  • 0 is true
  • any other number is false

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:

image

[
    {
        "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"
            ]
        ]
    }
]

typo in README

Great node - love it - has enabled me to clean up flows big time.

Found a little typo:
"... cant't ..." should be "... can't ..."

If a value cant't be treaten as `true` or `false` by comparing current input value to available formats

Show last boolean status

Show boolean status of last message as node status:

  • true: green
  • false: red
  • grey: undefined
  • white: default

installing Errors I

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.