Emoncms - drop time if not a number

and update docs.
This commit is contained in:
Dave Conway-Jones
2015-12-09 13:21:42 +00:00
parent 596736be75
commit bbed4bab9a
4 changed files with 17 additions and 11 deletions

View File

@@ -59,7 +59,7 @@ module.exports = function(RED) {
this.url += '&node=' + nodegroup;
}
if (typeof msg.time !== 'undefined') {
this.url += '&time=' + msg.time;
if (!isNaN(parseInt(msg.time))) { this.url += '&time=' + msg.time; }
}
http.get(this.url, function(res) {
msg.rc = res.statusCode;