I'm making an escape room. My functions contain puzzle logic so are relatively complex, and version controlling them as separate files is appealing. But they also want to send multiple outputs to specific topics.
For instance if I get a message from topic prop/switch maybe I want to send messages to prop/light and prop/maglock. Instead all my messages are rewritten to have the topic prop/switch. Which, because the topics are being rewritten, if I get my messages from an MQTT node and send them back into an MQTT node causes trouble.
I see this explicitly done on line 104.
I can't really think of a situation when it would be preferable to ignore the topic that my code explicitly chose for its results.
Also, I realize that I can work around this by explicitly calling node.send instead of returning values myself.
I'm making an escape room. My functions contain puzzle logic so are relatively complex, and version controlling them as separate files is appealing. But they also want to send multiple outputs to specific topics.
For instance if I get a message from topic
prop/switchmaybe I want to send messages toprop/lightandprop/maglock. Instead all my messages are rewritten to have the topicprop/switch. Which, because the topics are being rewritten, if I get my messages from an MQTT node and send them back into an MQTT node causes trouble.I see this explicitly done on line 104.
I can't really think of a situation when it would be preferable to ignore the topic that my code explicitly chose for its results.
Also, I realize that I can work around this by explicitly calling node.send instead of returning values myself.