From 7338a179914fe196968357c786534ef185530bb6 Mon Sep 17 00:00:00 2001 From: dceejay Date: Sat, 14 Feb 2015 17:56:29 +0000 Subject: [PATCH] Tiny tidy up of RBE node --- function/rbe/README.md | 14 +++++++++----- function/rbe/package.json | 2 +- function/rbe/rbe.html | 4 ++-- function/rbe/rbe.js | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/function/rbe/README.md b/function/rbe/README.md index ee47fb77..e7475bf5 100644 --- a/function/rbe/README.md +++ b/function/rbe/README.md @@ -1,7 +1,8 @@ node-red-node-rbe ================= -A Node-RED node that provides provides report-by-exception (RBE) and deadband capability. +A Node-RED node that provides +provides report-by-exception (RBE) and deadband capability. Install ------- @@ -14,15 +15,18 @@ Run the following command in the root directory of your Node-RED install Usage ----- -A simple node to provide report by exception (RBE) and deadband function - only passes on data if it has changed. +A simple node to provide report by exception (RBE) and deadband function +- only passes on data if it has changed. ###RBE mode -Outputs the **msg** if the **msg.payload** is different to the previous one. Works on numbers and strings. Useful for filtering out repeated messages of the same value. Saves bandwidth, etc... +Outputs the **msg** if the **msg.payload** is different to the previous one. +Works on numbers and strings. Useful for filtering out repeated messages of the +same value. Saves bandwidth, etc... ###Deadband mode In deadband mode the incoming payload should contain a parseable *number* and is - output only if greater than + or - the *band gap* away from the previous output. +output only if greater than + or - the *band gap* away from the previous output. -Will accept numbers, or strings like "18.4 C" or "$500" +Will accept numbers, or parseable strings like "18.4 C" or "$500" diff --git a/function/rbe/package.json b/function/rbe/package.json index 4fe6fa14..eef7d407 100644 --- a/function/rbe/package.json +++ b/function/rbe/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-rbe", - "version" : "0.0.1", + "version" : "0.0.2", "description" : "A Node-RED node that provides report-by-exception (RBE) and deadband capability.", "dependencies" : { }, diff --git a/function/rbe/rbe.html b/function/rbe/rbe.html index 254dd2d0..2476fa95 100644 --- a/function/rbe/rbe.html +++ b/function/rbe/rbe.html @@ -34,9 +34,9 @@ diff --git a/function/rbe/rbe.js b/function/rbe/rbe.js index ebfe5927..db0236fc 100644 --- a/function/rbe/rbe.js +++ b/function/rbe/rbe.js @@ -33,8 +33,8 @@ module.exports = function(RED) { } else { var n = parseFloat(msg.payload); - if (previous == null) { previous = n - node.gap; } if (!isNaN(n)) { + if (previous == null) { previous = n - node.gap; } if (Math.abs(n - previous) >= node.gap) { previous = n; node.send(msg);