According to https://github.com/node-red/node-red/issues/714#issuecomment-217383660, the original msg object needs to be modified and sent back for it to work. Not sure if this is the best fix (using .once() in the input event handler), but I got beanTemp.js working properly like this:
According to https://github.com/node-red/node-red/issues/714#issuecomment-217383660, the original
msg
object needs to be modified and sent back for it to work. Not sure if this is the best fix (using.once()
in theinput
event handler), but I got beanTemp.js working properly like this:At first I tried a persistent
msg
variable in the closure thattempDataReceived
could access, but that could lead to race conditions I think. See https://node-red.slack.com/archives/general/p1476118415001635