Skip to content
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

let trigger node be reset by boolean message #1554

Merged
merged 2 commits into from Jan 17, 2018

Conversation

dceejay
Copy link
Member

@dceejay dceejay commented Jan 14, 2018

currently to use msg.payload to reset a trigger that is in progress, it needs to match a string.

@coveralls
Copy link

coveralls commented Jan 14, 2018

Coverage Status

Coverage increased (+0.07%) to 86.407% when pulling cfe994e on let-trigger-node-reset-by-boolean into 4453a51 on 0.18.

@@ -80,7 +80,7 @@ module.exports = function(RED) {
var topic = msg.topic || "_none";
if (node.bytopic === "all") { topic = "_none"; }
node.topics[topic] = node.topics[topic] || {};
if (msg.hasOwnProperty("reset") || ((node.reset !== '') && (msg.payload == node.reset)) ) {
if (msg.hasOwnProperty("reset") || ((node.reset !== '') && msg.payload && msg.payload.toString && (msg.payload.toString() == node.reset)) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work if the desired reset word is "false" - as msg.payload will be false and this check won't pass.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@coveralls
Copy link

coveralls commented Jan 16, 2018

Coverage Status

Coverage increased (+0.03%) to 86.366% when pulling 6115f51 on let-trigger-node-reset-by-boolean into 4453a51 on 0.18.

@knolleary knolleary merged commit 9bc72c1 into 0.18 Jan 17, 2018
@knolleary knolleary deleted the let-trigger-node-reset-by-boolean branch May 10, 2018 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants