mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-12-27 07:21:08 +01:00
add reset capability to rue node
This commit is contained in:
@@ -18,6 +18,12 @@ module.exports = function(RED) {
|
||||
|
||||
node.previous = {};
|
||||
this.on("input",function(msg) {
|
||||
if (msg.hasOwnProperty("reset")) {
|
||||
if (msg.hasOwnProperty("topic") && (typeof msg.topic === "string") && (msg.topic !== "")) {
|
||||
delete node.previous[msg.topic];
|
||||
}
|
||||
else { node.previous = {}; }
|
||||
}
|
||||
if (msg.hasOwnProperty("payload")) {
|
||||
var t = msg.topic || "_no_topic";
|
||||
if ((this.func === "rbe") || (this.func === "rbei")) {
|
||||
|
||||
Reference in New Issue
Block a user