bartbutenaers / node-red-contrib-button-events

A Node-RED node to send events based on button actions
Apache License 2.0
13 stars 3 forks source link

Boolean Inputs Not Recognized #10

Open Boh1 opened 2 years ago

Boh1 commented 2 years ago

When selecting Boolean true/false as the type for Up/Down values respectively, an error message is generated during execution:

Input property msg.payload should contain the specified low or high value.

This was tested using a Trigger:State node as the input, set to output Boolean values. But the same behaviour can be reproduced using simple Inject nodes as well.

I can work around this by setting Up/Down to type Number and then using Switch and Change nodes to remap the true/false input to 1/0 instead. A bit of a hack.

Are Booleans actually supported for Up/Down values?

bartbutenaers commented 2 years ago

Hi @Boh1,

Thanks for reporting this issue! I have added a fix for this on Github. Note that this fixed version is not available on NPM yet, because @tsknightstorm and I have been working recently on a major release of this node, but were waiting for feedback from the community. Will add a reminder on Discourse, because would like some folks to test the new calibration feature before we release this on NPM.

If you want to try meanwhile whether this fix works correctly (and also didn't mess up other value types), you can install it directly from this Github repository. To do that you need to install git and then execute (from within your .node-red folder):

npm install bartbutenaers/node-red-contrib-button-events

Test feedback is appreciated! Bart