-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dont works on boolean or integers #3
Comments
It is the same for integers, in the case of "0". |
I believe map.js line 74 "if ( !keyValue ) { return null; }" causes this behavior. |
I agree that the code could be improved to properly handle values that evaluate to false. Apart from map.js line 74, I think there may be other places where undefined/null/false/0 handling could be improved. Unfortunately at the moment I don't have time to investigate which code requires improvements to properly handle such edge cases, implement the necessary changes, and set up test scenarios for testing these edge cases. As such, for now you will need to use some work-around. For example, a standard 'change' node could be used for the boolean mapping. Alternatively, you could try converting the payload into a string before passing the message to one of the node-red-contrib-map nodes. Of course if you are willing to implement and test the necessary fixes to handle these edge cases, I'm more than willing to accept a pull request. |
on map-map, if the input is a boolean, it doesnt works for the false input.
It's works for the true value
payload: true => payload: "ON"
payload: false => payload: "Unknown: false"
The mapping is
true = ON
false = OFF
The text was updated successfully, but these errors were encountered: