mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
add rbe to missing payload compatible list.
This commit is contained in:
parent
3896a82bd8
commit
b112f03a64
@ -25,25 +25,27 @@ module.exports = function(RED) {
|
||||
|
||||
var previous = null;
|
||||
this.on("input",function(msg) {
|
||||
if (this.func === "rbe") {
|
||||
if (msg.payload != previous) {
|
||||
previous = msg.payload;
|
||||
node.send(msg);
|
||||
}
|
||||
}
|
||||
else {
|
||||
var n = parseFloat(msg.payload);
|
||||
if (!isNaN(n)) {
|
||||
if (previous == null) { previous = n - node.gap; }
|
||||
if (Math.abs(n - previous) >= node.gap) {
|
||||
previous = n;
|
||||
if (msg.hasOwnProperty("payload")) {
|
||||
if (this.func === "rbe") {
|
||||
if (msg.payload != previous) {
|
||||
previous = msg.payload;
|
||||
node.send(msg);
|
||||
}
|
||||
}
|
||||
else {
|
||||
node.warn("no number found in payload");
|
||||
var n = parseFloat(msg.payload);
|
||||
if (!isNaN(n)) {
|
||||
if (previous == null) { previous = n - node.gap; }
|
||||
if (Math.abs(n - previous) >= node.gap) {
|
||||
previous = n;
|
||||
node.send(msg);
|
||||
}
|
||||
}
|
||||
else {
|
||||
node.warn("no number found in payload");
|
||||
}
|
||||
}
|
||||
}
|
||||
} // ignore msg with no payload property.
|
||||
});
|
||||
}
|
||||
RED.nodes.registerType("rbe",RbeNode);
|
||||
|
Loading…
Reference in New Issue
Block a user