From c63575e538f4c33d06b44729229de38d3c16811d Mon Sep 17 00:00:00 2001 From: dceejay Date: Tue, 16 Jun 2015 10:47:44 +0100 Subject: [PATCH 01/48] skip other email test also temporarily --- test/social/email/61-email_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/social/email/61-email_spec.js b/test/social/email/61-email_spec.js index 6a072f35..030a5b30 100644 --- a/test/social/email/61-email_spec.js +++ b/test/social/email/61-email_spec.js @@ -73,7 +73,7 @@ describe('email Node', function() { }); - describe('email in', function() { + describe.skip('email in', function() { it('should load with defaults', function(done) { var flow = [ { id:"n1", type:"e-mail in", wires:[["n2"]] }, From b33c6605b166f270b8766afcc3a88a3e69b3543d Mon Sep 17 00:00:00 2001 From: dceejay Date: Tue, 16 Jun 2015 17:41:32 +0100 Subject: [PATCH 02/48] fix README for Twitter so it renders correctly in flows.nodered.org --- social/twitter/README.md | 5 ++--- social/twitter/package.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/social/twitter/README.md b/social/twitter/README.md index ec0485e9..c5661f44 100644 --- a/social/twitter/README.md +++ b/social/twitter/README.md @@ -5,7 +5,7 @@ node-red-node-twitter The Twitter API will **NOT** deliver 100% of all tweets. This does **NOT** give access to the Twitter Firehose. -Tweets of who you follow will include their retweets and favourites. +Tweets of who you follow will include their retweets and favourites. **Note** : This is the same node as is/was in the core of Node-RED. If you already have it installed you do NOT need this node. However it will be deprecated from @@ -55,5 +55,4 @@ To send a Direct Message (DM) - use a payload like. D {username} {message} -If **msg.media** exists and is a Buffer object, this node will treat it - as an image and attach it to the tweet.

+If **msg.media** exists and is a Buffer object, this node will treat it as an image and attach it to the tweet. diff --git a/social/twitter/package.json b/social/twitter/package.json index e80373fe..f2ddbb9b 100644 --- a/social/twitter/package.json +++ b/social/twitter/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-twitter", - "version" : "0.0.4", + "version" : "0.0.5", "description" : "A Node-RED node to talk to Twitter", "dependencies" : { "twitter-ng": "0.6.2", From 56bb10642a3bb6cb0dc472506786f51c6c4ed142 Mon Sep 17 00:00:00 2001 From: dceejay Date: Tue, 16 Jun 2015 21:37:22 +0100 Subject: [PATCH 03/48] Update Note(s) in READMEs for all moved out nodes. redis, mongo, email, feedparse, twitter, irc, arduino, serialport --- hardware/Arduino/README.md | 6 ++---- hardware/Arduino/package.json | 2 +- io/serialport/README.md | 4 ++-- io/serialport/package.json | 2 +- social/email/README.md | 3 ++- social/email/package.json | 2 +- social/feedparser/README.md | 6 ++---- social/feedparser/package.json | 2 +- social/irc/README.md | 6 ++---- social/irc/package.json | 2 +- social/twitter/README.md | 6 ++---- social/twitter/package.json | 2 +- storage/mongodb/README.md | 4 ++-- storage/mongodb/package.json | 2 +- storage/redis/README.md | 4 ++-- storage/redis/package.json | 2 +- 16 files changed, 24 insertions(+), 31 deletions(-) diff --git a/hardware/Arduino/README.md b/hardware/Arduino/README.md index e85f5c10..b89fa78b 100644 --- a/hardware/Arduino/README.md +++ b/hardware/Arduino/README.md @@ -3,10 +3,8 @@ node-red-node-arduino A Node-RED node to talk to an Arduino running firmata. -**Note** : This is the same node as is/was in the core of Node-RED. If you already -have it installed you do NOT need this node. However it will be deprecated from -the core in due course, at which point you will need to install it from here if -still required. +**Note** : This is the same node as was in the core of Node-RED. +As of v0.10.8 you will need to install it from here if still required. Install ------- diff --git a/hardware/Arduino/package.json b/hardware/Arduino/package.json index 247b5136..3129d275 100644 --- a/hardware/Arduino/package.json +++ b/hardware/Arduino/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-arduino", - "version" : "0.0.1", + "version" : "0.0.2", "description" : "A Node-RED node to talk to an Arduino running firmata", "dependencies" : { "arduino-firmata" : "0.3.2" diff --git a/io/serialport/README.md b/io/serialport/README.md index e56c22d5..fcb05611 100644 --- a/io/serialport/README.md +++ b/io/serialport/README.md @@ -3,8 +3,8 @@ node-red-node-serialport Node-RED nodes to talk to an hardware Serial port. -**Note** : This is the same node as is/was in the core of Node-RED. If you already -have it installed you do NOT need this node. +**Note** : This is the same node as was in the core of Node-RED. +As of v0.10.8 it will be installed from here instead. Install ------- diff --git a/io/serialport/package.json b/io/serialport/package.json index 29818e27..d70d229c 100644 --- a/io/serialport/package.json +++ b/io/serialport/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-serialport", - "version" : "0.0.1", + "version" : "0.0.2", "description" : "Node-RED nodes to talk to an serial port", "dependencies" : { "serialport" : "1.7.*" diff --git a/social/email/README.md b/social/email/README.md index 88e9c7de..3f37cf2d 100644 --- a/social/email/README.md +++ b/social/email/README.md @@ -3,7 +3,8 @@ node-red-node-email Node-RED nodes to send and receive simple emails. -**Note** : This is the same node as is/was in the core of Node-RED. +**Note** : This is the same node as was in the core of Node-RED. +As of v0.10.8 it will be installed from here instead. Pre-requisite ------------- diff --git a/social/email/package.json b/social/email/package.json index 9f3f39c7..01c63c96 100644 --- a/social/email/package.json +++ b/social/email/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-email", - "version" : "0.0.2", + "version" : "0.0.3", "description" : "Node-RED nodes to send and receive simple emails", "dependencies" : { "nodemailer" : "1.3.4", diff --git a/social/feedparser/README.md b/social/feedparser/README.md index 2c03a2d8..109a92a6 100644 --- a/social/feedparser/README.md +++ b/social/feedparser/README.md @@ -3,10 +3,8 @@ node-red-node-feedparser A Node-RED node to read RSS and Atom feeds. -**Note** : This is the same node as is/was in the core of Node-RED. If you already -have it installed you do NOT need this node. However it will be deprecated from -the core in due course, at which point you will need to install it from here if -still required. +**Note** : This is the same node as was in the core of Node-RED. +As of v0.10.8 it will be installed from here instead. Install ------- diff --git a/social/feedparser/package.json b/social/feedparser/package.json index 65c646d7..8ab1bed7 100644 --- a/social/feedparser/package.json +++ b/social/feedparser/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-feedparser", - "version" : "0.0.3", + "version" : "0.0.4", "description" : "A Node-RED node to get RSS Atom feeds.", "dependencies" : { "feedparser" : "0.19.2", diff --git a/social/irc/README.md b/social/irc/README.md index eab139df..c30ea484 100644 --- a/social/irc/README.md +++ b/social/irc/README.md @@ -3,10 +3,8 @@ node-red-node-irc A Node-RED node to talk to an IRC server. -**Note** : This is the same node as is/was in the core of Node-RED. If you already -have it installed you do NOT need this node. However it will be deprecated from -the core in due course, at which point you will need to install it from here if -still required. +**Note** : This is the same node as was in the core of Node-RED. +As of v0.10.8 you will need to install it from here if still required. Install ------- diff --git a/social/irc/package.json b/social/irc/package.json index 32f213c7..7b82763d 100644 --- a/social/irc/package.json +++ b/social/irc/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-irc", - "version" : "0.0.2", + "version" : "0.0.3", "description" : "A Node-RED node to talk to an IRC server", "dependencies" : { "irc" : "0.3.11" diff --git a/social/twitter/README.md b/social/twitter/README.md index c5661f44..1c9035e1 100644 --- a/social/twitter/README.md +++ b/social/twitter/README.md @@ -7,10 +7,8 @@ The Twitter API will **NOT** deliver 100% of all tweets. This does **NOT** give Tweets of who you follow will include their retweets and favourites. -**Note** : This is the same node as is/was in the core of Node-RED. If you already -have it installed you do NOT need this node. However it will be deprecated from -the core in due course, at which point you will need to install it from here if -still required. +**Note** : This is the same node as was in the core of Node-RED. +As of v0.10.8 it will be installed from here instead. Install ------- diff --git a/social/twitter/package.json b/social/twitter/package.json index f2ddbb9b..6533df55 100644 --- a/social/twitter/package.json +++ b/social/twitter/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-twitter", - "version" : "0.0.5", + "version" : "0.0.6", "description" : "A Node-RED node to talk to Twitter", "dependencies" : { "twitter-ng": "0.6.2", diff --git a/storage/mongodb/README.md b/storage/mongodb/README.md index 727bbee2..e73db656 100644 --- a/storage/mongodb/README.md +++ b/storage/mongodb/README.md @@ -3,8 +3,8 @@ node-red-node-mongodb A Node-RED node to save data in a MongoDB database. -**Note** : This is the same node as is/was in the core of Node-RED. If you already -have it installed you do NOT need this node. +**Note** : This is the same node as was in the core of Node-RED. +As of v0.10.8 you will need to install it from here if still required. Pre-requisite ------------- diff --git a/storage/mongodb/package.json b/storage/mongodb/package.json index 32cfb177..7abf7cf8 100644 --- a/storage/mongodb/package.json +++ b/storage/mongodb/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-mongodb", - "version" : "0.0.1", + "version" : "0.0.2", "description" : "Node-RED nodes to talk to an Mongo database", "dependencies" : { "mongodb" : "1.3.6" diff --git a/storage/redis/README.md b/storage/redis/README.md index 9dd58076..ba19b92d 100644 --- a/storage/redis/README.md +++ b/storage/redis/README.md @@ -3,8 +3,8 @@ node-red-node-redis A Node-RED node to save data in a Redis database. -**Note** : This is the same node as is/was in the core of Node-RED. If you already -have it installed you do NOT need this node. +**Note** : This is the same node as was in the core of Node-RED. +As of v0.10.8 you will need to install it from here if still required. Pre-requisite ------------- diff --git a/storage/redis/package.json b/storage/redis/package.json index b1bab230..7260101e 100644 --- a/storage/redis/package.json +++ b/storage/redis/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-redis", - "version" : "0.0.1", + "version" : "0.0.2", "description" : "A Node-RED node to save data to an Redis database", "dependencies" : { "redis" : "0.12.1" From fc05ddd035247c645a485d0320ba6699c7a51e8f Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 19 Jun 2015 16:54:07 +0100 Subject: [PATCH 04/48] Re-enable email node basic tests... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit it’s a start…. --- social/email/61-email.js | 4 +- test/social/email/61-email_spec.js | 92 +++++++++++++++--------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/social/email/61-email.js b/social/email/61-email.js index bf315fed..195d390d 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -127,8 +127,8 @@ module.exports = function(RED) { RED.nodes.createNode(this,n); this.name = n.name; this.repeat = n.repeat * 1000 || 300000; - this.inserver = n.server || globalkeys.server || "imap.gmail.com"; - this.inport = n.port || globalkeys.port || "993"; + this.inserver = n.server || (globalkeys && globalkeys.server) || "imap.gmail.com"; + this.inport = n.port || (globalkeys && globalkeys.port) || "993"; this.box = n.box || "INBOX"; var flag = false; diff --git a/test/social/email/61-email_spec.js b/test/social/email/61-email_spec.js index 030a5b30..9aba594d 100644 --- a/test/social/email/61-email_spec.js +++ b/test/social/email/61-email_spec.js @@ -30,56 +30,13 @@ describe('email Node', function() { helper.stopServer(done); }); - describe.skip('email out', function() { + describe('email in', function() { it('should load with defaults', function(done) { - var flow = [ { id:"n1", type:"e-mail", name:"emailout", wires:[[]] } ]; - helper.load(emailNode, flow, function() { - var n1 = helper.getNode("n1"); - n1.should.have.property('name', "emailout"); - done(); - }); - }); - - it('should send an email', function(done) { - var smtpTransport = require("nodemailer").createTransport(); - //var spy = sinon.stub(smtpTransport, 'sendMail', function(arg1,arg2,arg3,arg4) { - //console.log("HELLO"); - //console.log(arg1,arg2,arg3,arg4); - //done(); - //}); - var flow = [ { id:"n1", type:"e-mail", name:"emailout", outserver:"smtp.gmail.com", outport:"465", wires:[[]] } ]; - helper.load(emailNode, flow, function() { - var n1 = helper.getNode("n1"); - n1.should.have.property('name', "emailout"); - n1.emit("input", {payload:"Hello World"}); - //done(); - }); - setTimeout(function() { - try { - var logEvents = helper.log().args.filter(function(evt) { - return evt[0].type == "e-mail"; - }); - //console.log(logEvents); - logEvents.should.have.length(1); - logEvents[0][0].should.have.a.property('msg'); - logEvents[0][0].msg.toString().should.startWith("Error: connect ECONNREFUSED"); - done(); - } - catch(e) { done(e); } - //finally { smtpTransport.sendMail.restore(); } - },150); - }) - - }); - - describe.skip('email in', function() { - - it('should load with defaults', function(done) { - var flow = [ { id:"n1", type:"e-mail in", wires:[["n2"]] }, - {id:"n2", type:"helper"} ]; + var flow = [ { id:"n1", type:"e-mail in", name:"emailin", wires:[[]] } ]; helper.load(emailNode, flow, function() { var n1 = helper.getNode("n1"); + n1.should.have.property('name', "emailin"); n1.should.have.property("repeat", 300000); n1.should.have.property("inserver", "imap.gmail.com"); n1.should.have.property("inport", "993"); @@ -104,4 +61,47 @@ describe('email Node', function() { }); + describe('email out', function() { + + it('should load with defaults', function(done) { + var flow = [ { id:"n1", type:"e-mail", name:"emailout", wires:[[]] } ]; + helper.load(emailNode, flow, function() { + var n1 = helper.getNode("n1"); + n1.should.have.property('name', "emailout"); + done(); + }); + }); + + it('should fail to send an email (no valid creds)', function(done) { + var smtpTransport = require("nodemailer").createTransport(); + //var spy = sinon.stub(smtpTransport, 'sendMail', function(arg1,arg2,arg3,arg4) { + //console.log("HELLO"); + //console.log(arg1,arg2,arg3,arg4); + //done(); + //}); + var flow = [ { id:"n1", type:"e-mail", name:"emailout", outserver:"smtp.gmail.com", outport:"465", wires:[[]] } ]; + helper.load(emailNode, flow, function() { + var n1 = helper.getNode("n1"); + n1.should.have.property('name', "emailout"); + n1.emit("input", {payload:"Hello World"}); + //done(); + }); + setTimeout(function() { + try { + var logEvents = helper.log().args.filter(function(evt) { + return evt[0].type == "e-mail"; + }); + //console.log(logEvents); + logEvents.should.have.length(3); + logEvents[2][0].should.have.a.property('msg'); + logEvents[2][0].msg.toString().should.startWith("Error: connect ECONNREFUSED"); + done(); + } + catch(e) { done(e); } + //finally { smtpTransport.sendMail.restore(); } + },150); + }) + + }); + }); From d21b24bbce4812c2666f22424ccd9017dbc74712 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 19 Jun 2015 22:34:07 +0100 Subject: [PATCH 05/48] check header properties in email node to close #118 --- social/email/61-email.js | 6 +++--- social/email/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/social/email/61-email.js b/social/email/61-email.js index 195d390d..dfc594b6 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -202,9 +202,9 @@ module.exports = function(RED) { stream.on('end', function() { if (info.which !== 'TEXT') { var head = Imap.parseHeader(buffer); - pay.from = head.from[0]; - pay.topic = head.subject[0]; - pay.date = head.date[0]; + if (head.hasOwnProperty("from")) { pay.from = head.from[0]; } + if (head.hasOwnProperty("topic")) { pay.topic = head.subject[0]; } + if (head.hasOwnProperty("date")) { pay.date = head.date[0]; } pay.header = head; } else { var parts = buffer.split("Content-Type"); diff --git a/social/email/package.json b/social/email/package.json index 01c63c96..8c77a814 100644 --- a/social/email/package.json +++ b/social/email/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-email", - "version" : "0.0.3", + "version" : "0.0.4", "description" : "Node-RED nodes to send and receive simple emails", "dependencies" : { "nodemailer" : "1.3.4", From 04f43851e572f17ab5abbbd36378fa388a883369 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 19 Jun 2015 22:38:44 +0100 Subject: [PATCH 06/48] fix incorrect test of email header fix for #118 (mea culpa) --- social/email/61-email.js | 2 +- social/email/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/social/email/61-email.js b/social/email/61-email.js index dfc594b6..fa969d3d 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -203,7 +203,7 @@ module.exports = function(RED) { if (info.which !== 'TEXT') { var head = Imap.parseHeader(buffer); if (head.hasOwnProperty("from")) { pay.from = head.from[0]; } - if (head.hasOwnProperty("topic")) { pay.topic = head.subject[0]; } + if (head.hasOwnProperty("subject")) { pay.topic = head.subject[0]; } if (head.hasOwnProperty("date")) { pay.date = head.date[0]; } pay.header = head; } else { diff --git a/social/email/package.json b/social/email/package.json index 8c77a814..f407b388 100644 --- a/social/email/package.json +++ b/social/email/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-email", - "version" : "0.0.4", + "version" : "0.0.5", "description" : "Node-RED nodes to send and receive simple emails", "dependencies" : { "nodemailer" : "1.3.4", From 3f08764dd4a5e49e7c48f0980c3dd3431a117690 Mon Sep 17 00:00:00 2001 From: dceejay Date: Mon, 29 Jun 2015 17:29:12 +0100 Subject: [PATCH 07/48] Let RBE node handle multiple msg.topic at the same time. --- function/rbe/README.md | 3 +++ function/rbe/package.json | 2 +- function/rbe/rbe.html | 2 ++ function/rbe/rbe.js | 13 +++++++------ 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/function/rbe/README.md b/function/rbe/README.md index e7475bf5..c9a5da06 100644 --- a/function/rbe/README.md +++ b/function/rbe/README.md @@ -18,6 +18,9 @@ Usage A simple node to provide report by exception (RBE) and deadband function - only passes on data if it has changed. +This works on a per **msg.topic** basis. This means that a single rbe node can +handle multiple topics at the same time. + ###RBE mode Outputs the **msg** if the **msg.payload** is different to the previous one. diff --git a/function/rbe/package.json b/function/rbe/package.json index 5add0be8..a0dde101 100644 --- a/function/rbe/package.json +++ b/function/rbe/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-rbe", - "version" : "0.0.4", + "version" : "0.0.5", "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 2476fa95..9788b4b7 100644 --- a/function/rbe/rbe.html +++ b/function/rbe/rbe.html @@ -38,6 +38,8 @@ different to the previous one. Works on numbers and strings.

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.

+

Note: This works on a per msg.topic basis. This means that a single rbe node can +handle multiple topics at the same time.

- - - - @@ -49,7 +50,7 @@ handle multiple topics at the same time.

defaults: { name: {value:""}, func: {value:"rbe"}, - gap: {value:"",validate:RED.validators.regex(/^(\d*|)$/)} + gap: {value:"",validate:RED.validators.regex(/^(\d*|)(%|)$/)} }, inputs:1, outputs:1, diff --git a/function/rbe/rbe.js b/function/rbe/rbe.js index 057e4a89..06ded8a4 100644 --- a/function/rbe/rbe.js +++ b/function/rbe/rbe.js @@ -21,6 +21,13 @@ module.exports = function(RED) { RED.nodes.createNode(this,n); this.func = n.func || "rbe"; this.gap = n.gap || 0; + this.pc = false; + if (this.gap.substr(-1) === "%") { + this.pc = true; + this.gap = parseFloat(this.gap); + } + console.log(this.gap, this.pc); + this.g = this.gap; var node = this; node.previous = {}; @@ -36,6 +43,7 @@ module.exports = function(RED) { else { var n = parseFloat(msg.payload); if (!isNaN(n)) { + if (node.pc) { node.gap = (node.previous[t] * node.g / 100) || 0; } if (!node.previous.hasOwnProperty(t)) { node.previous[t] = n - node.gap; } if (Math.abs(n - node.previous[t]) >= node.gap) { node.previous[t] = n; From ce315bfe841c035f664ab0beefd4ffe6d04f43a9 Mon Sep 17 00:00:00 2001 From: dceejay Date: Sat, 4 Jul 2015 22:21:00 +0100 Subject: [PATCH 25/48] fix sensorTag linting --- hardware/sensorTag/79-sensorTag.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hardware/sensorTag/79-sensorTag.js b/hardware/sensorTag/79-sensorTag.js index b9849867..a30435e0 100644 --- a/hardware/sensorTag/79-sensorTag.js +++ b/hardware/sensorTag/79-sensorTag.js @@ -18,7 +18,7 @@ module.exports = function(RED) { "use strict"; var SensorTag = require('sensortag'); - function sensorTagNode(n) { + var s = function sensorTagNode(n) { RED.nodes.createNode(this,n); this.name = n.name; this.topic = n.topic; @@ -157,5 +157,6 @@ module.exports = function(RED) { node.stag.unnotifySimpleKey(function() {}); } } + RED.nodes.registerType("sensorTag",sensorTagNode); } From f57d8b388a7f5a006fc9d1a93f6dccafc6f707f2 Mon Sep 17 00:00:00 2001 From: dceejay Date: Sun, 5 Jul 2015 15:29:24 +0100 Subject: [PATCH 26/48] Better fix for sensorTag node linting - as in actually still works... --- hardware/sensorTag/79-sensorTag.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hardware/sensorTag/79-sensorTag.js b/hardware/sensorTag/79-sensorTag.js index a30435e0..821e7031 100644 --- a/hardware/sensorTag/79-sensorTag.js +++ b/hardware/sensorTag/79-sensorTag.js @@ -16,9 +16,9 @@ module.exports = function(RED) { "use strict"; - var SensorTag = require('sensortag'); + var SensorTag = require("sensortag"); - var s = function sensorTagNode(n) { + function SensorTagNode(n) { RED.nodes.createNode(this,n); this.name = n.name; this.topic = n.topic; @@ -111,7 +111,7 @@ module.exports = function(RED) { }); } - function enable(node) { + var enable = function(node) { if (node.temperature) { node.stag.notifyIrTemperature(function() {}); } else { @@ -158,5 +158,5 @@ module.exports = function(RED) { } } - RED.nodes.registerType("sensorTag",sensorTagNode); + RED.nodes.registerType("sensorTag",SensorTagNode); } From 35eb6d71cd407eca0cbcfdc05a3b10c8d87a0f3b Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sun, 5 Jul 2015 22:44:09 +0100 Subject: [PATCH 27/48] remove superflous console.log from rbe node --- function/rbe/rbe.js | 1 - 1 file changed, 1 deletion(-) diff --git a/function/rbe/rbe.js b/function/rbe/rbe.js index 06ded8a4..ea7526da 100644 --- a/function/rbe/rbe.js +++ b/function/rbe/rbe.js @@ -26,7 +26,6 @@ module.exports = function(RED) { this.pc = true; this.gap = parseFloat(this.gap); } - console.log(this.gap, this.pc); this.g = this.gap; var node = this; From 322c996064dc7b9f88f58667a267e223b413fc0c Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Thu, 9 Jul 2015 23:27:15 +0100 Subject: [PATCH 28/48] Let dweetio node send objects without alteration --- social/dweetio/55-dweetio.js | 13 +++++++++---- social/dweetio/package.json | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/social/dweetio/55-dweetio.js b/social/dweetio/55-dweetio.js index 88d26562..9f09498e 100644 --- a/social/dweetio/55-dweetio.js +++ b/social/dweetio/55-dweetio.js @@ -25,12 +25,18 @@ module.exports = function(RED) { if (dweetio == null) { dweetio = new DweetClient(); } var node = this; + var isObject = function(a) { + return (!!a) && (a.constructor === Object); + }; + this.on("input",function(msg) { - //if (typeof(msg.payload) === 'object') { + if (!isObject(msg.payload)) { + msg.payload = {payload:msg.payload}; + } var thing = node.thing || msg.thing; try { - dweetio.dweet_for(thing, {payload:msg.payload}, function(err, dweet) { - //console.log(dweet.thing); // "my-thing" + dweetio.dweet_for(thing, msg.payload, function(err, dweet) { + //console.log(dweet.thing); // "my-thing" //console.log(dweet.content); // The content of the dweet //console.log(dweet.created); // The create date of the dweet }); @@ -38,7 +44,6 @@ module.exports = function(RED) { catch (err) { node.log(err); } - //} else { node.warn("Dweetio only sends payload objects."); } }); } diff --git a/social/dweetio/package.json b/social/dweetio/package.json index ad23c5cf..73b1aecc 100644 --- a/social/dweetio/package.json +++ b/social/dweetio/package.json @@ -1,9 +1,9 @@ { "name" : "node-red-node-dweetio", - "version" : "0.0.5", + "version" : "0.0.4", "description" : "A Node-RED node to send and receive simple dweets", "dependencies" : { - "node-dweetio" : "0.0.11" + "node-dweetio" : "0.0.12" }, "repository" : { "type":"git", From c98d8a4baaa4b4b5de9e57fda5c59e3599f7d3a0 Mon Sep 17 00:00:00 2001 From: dceejay Date: Sun, 12 Jul 2015 20:13:41 +0100 Subject: [PATCH 29/48] Cleanup package.json and Gruntfile for v0.12 use --- Gruntfile.js | 6 +++--- package.json | 18 ++++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index bfab95e5..6d936e19 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -42,7 +42,7 @@ module.exports = function(grunt) { //"sub": true, // don't warn that foo['bar'] should be written as foo.bar ////"unused": true, // Check for unused functions ////"forin":false, // turn off check for "for (x in y...)" - "reporter": require('jshint-stylish') + //"reporter": require('jshint-stylish') }, all: { src: ['*/*.js','*/*/*.js'], @@ -59,8 +59,8 @@ module.exports = function(grunt) { inlinelint: { html: ['*/*/*.html'], options: { - jshintrc: ".jshintrc", - reporter: require('jshint-stylish') + jshintrc: ".jshintrc" + //,reporter: require('jshint-stylish') } }, jscs: { diff --git a/package.json b/package.json index 956faf1e..68aa3e92 100644 --- a/package.json +++ b/package.json @@ -17,17 +17,15 @@ ], "devDependencies": { "grunt": "0.4.5", - "grunt-cli": "0.1.13", "grunt-simple-mocha": "0.4.0", - "grunt-contrib-jshint": "0.11.0", - "grunt-lint-inline": "0.4.3", - "grunt-jscs": "0.8.*", - "jshint-stylish": "1.0.1", - "mocha": "2.1.0", - "should": "4.6.5", - "sinon": "1.12.2", - "supertest": "0.15.0", - "proxyquire": "1.4.0", + "grunt-contrib-jshint": "0.11.2", + "grunt-lint-inline": "0.4.4", + "grunt-jscs": "1.8.*", + "mocha": "2.2.5", + "should": "7.0.1", + "sinon": "1.15.4", + "supertest": "1.0.1", + "proxyquire": "1.6.0", "pushbullet": "1.4.*", "when": "^3.6.4", "exif": "0.4.0", From 50c9a5f1e12dfbdf3c795028fa3e54e83f614802 Mon Sep 17 00:00:00 2001 From: dceejay Date: Sun, 12 Jul 2015 20:14:24 +0100 Subject: [PATCH 30/48] Fix RBE node to pass tests (and add % diff) test --- function/rbe/package.json | 2 +- function/rbe/rbe.js | 2 +- test/function/rbe/rbe_spec.js | 37 +++++++++++++++++++++++++++++++---- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/function/rbe/package.json b/function/rbe/package.json index 82993da4..e9a86991 100644 --- a/function/rbe/package.json +++ b/function/rbe/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-rbe", - "version" : "0.0.6", + "version" : "0.0.7", "description" : "A Node-RED node that provides report-by-exception (RBE) and deadband capability.", "dependencies" : { }, diff --git a/function/rbe/rbe.js b/function/rbe/rbe.js index ea7526da..456df05c 100644 --- a/function/rbe/rbe.js +++ b/function/rbe/rbe.js @@ -20,7 +20,7 @@ module.exports = function(RED) { function RbeNode(n) { RED.nodes.createNode(this,n); this.func = n.func || "rbe"; - this.gap = n.gap || 0; + this.gap = n.gap || "0"; this.pc = false; if (this.gap.substr(-1) === "%") { this.pc = true; diff --git a/test/function/rbe/rbe_spec.js b/test/function/rbe/rbe_spec.js index 9a885b52..e5815f94 100644 --- a/test/function/rbe/rbe_spec.js +++ b/test/function/rbe/rbe_spec.js @@ -37,13 +37,13 @@ describe('rbe node', function() { var n1 = helper.getNode("n1"); n1.should.have.property("name", "rbe1"); n1.should.have.property("func", "rbe"); - n1.should.have.property("gap", 0); + n1.should.have.property("gap", "0"); done(); }); }); it('should only send output if payload changes', function(done) { - var flow = [{"id":"n1", "type":"rbe", func:"rbe", gap:0, wires:[["n2"]] }, + var flow = [{"id":"n1", "type":"rbe", func:"rbe", gap:"0", wires:[["n2"]] }, {id:"n2", type:"helper"} ]; helper.load(testNode, flow, function() { var n1 = helper.getNode("n1"); @@ -70,7 +70,7 @@ describe('rbe node', function() { }); it('should only send output if more than x away from original value', function(done) { - var flow = [{"id":"n1", "type":"rbe", func:"gap", gap:10, wires:[["n2"]] }, + var flow = [{"id":"n1", "type":"rbe", func:"gap", gap:"10", wires:[["n2"]] }, {id:"n2", type:"helper"} ]; helper.load(testNode, flow, function() { var n1 = helper.getNode("n1"); @@ -100,8 +100,37 @@ describe('rbe node', function() { }); }); + it('should only send output if more than x% away from original value', function(done) { + var flow = [{"id":"n1", "type":"rbe", func:"gap", gap:"10%", wires:[["n2"]] }, + {id:"n2", type:"helper"} ]; + helper.load(testNode, flow, function() { + var n1 = helper.getNode("n1"); + var n2 = helper.getNode("n2"); + var c = 0; + n2.on("input", function(msg) { + if (c === 0) { + msg.should.have.a.property("payload", 100); + } + else if (c === 1) { + msg.should.have.a.property("payload", 120); + } + else { + msg.should.have.a.property("payload", 132); + done(); + } + c += 1; + }); + n1.emit("input", {payload:100}); + n1.emit("input", {payload:95}); + n1.emit("input", {payload:105}); + n1.emit("input", {payload:120}); + n1.emit("input", {payload:130}); + n1.emit("input", {payload:132}); + }); + }); + it('should warn if no number found in gap mode', function(done) { - var flow = [{"id":"n1", "type":"rbe", func:"gap", gap:10, wires:[["n2"]] }, + var flow = [{"id":"n1", "type":"rbe", func:"gap", gap:"10", wires:[["n2"]] }, {id:"n2", type:"helper"} ]; helper.load(testNode, flow, function() { var n1 = helper.getNode("n1"); From f1c8cb5e83463f0c6c72211437a1f049c16daf72 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 17 Jul 2015 13:52:19 +0100 Subject: [PATCH 31/48] Fix twitter auth --- social/twitter/27-twitter.html | 1 + social/twitter/package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/social/twitter/27-twitter.html b/social/twitter/27-twitter.html index 8ebda615..678e9d66 100644 --- a/social/twitter/27-twitter.html +++ b/social/twitter/27-twitter.html @@ -39,6 +39,7 @@ }, exportable: false, oneditprepare: function() { + var twitterConfigNodeId = this.id; var clickhere = this._("twitter.label.clickhere"); var twitterID = this._("twitter.label.twitter-id"); function showTwitterAuthStart() { diff --git a/social/twitter/package.json b/social/twitter/package.json index 6a2a3377..ded248a6 100644 --- a/social/twitter/package.json +++ b/social/twitter/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-twitter", - "version" : "0.1.0", + "version" : "0.1.1", "description" : "A Node-RED node to talk to Twitter", "dependencies" : { "twitter-ng": "0.6.2", From f7846c284b35b018862ad515bc9e9b7c8135cef7 Mon Sep 17 00:00:00 2001 From: Ben Hardill Date: Tue, 21 Jul 2015 09:17:31 +0100 Subject: [PATCH 32/48] fix typo in sensorTag type --- hardware/sensorTag/79-sensorTag.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/sensorTag/79-sensorTag.js b/hardware/sensorTag/79-sensorTag.js index 821e7031..191454e9 100644 --- a/hardware/sensorTag/79-sensorTag.js +++ b/hardware/sensorTag/79-sensorTag.js @@ -142,7 +142,7 @@ module.exports = function(RED) { } else { node.stag.unnotifyGyroscope(function() {}); } - if (node.stag.type === "cc2560") { + if (node.stag.type === "cc2650") { if (node.luxometer) { node.stag.enableLuxometer(function() {}); node.stag.notifyLuxometer(function() {}); From 8576a9f1c088f6708e1ca2f5b39caaf7362ff893 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 22 Jul 2015 12:14:51 +0100 Subject: [PATCH 33/48] Add node 0.12 and tidy up debug --- .travis.yml | 1 + package.json | 2 +- test/helper.js | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2d5f1778..0ccea2cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: node_js node_js: - "0.10" + - "0.12" #before_install: # - npm install -g npm@~1.4.28 before_script: diff --git a/package.json b/package.json index 68aa3e92..28f9017c 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,6 @@ "imap" : "0.8.14" }, "engines": { - "node": ">=0.8 <0.11" + "node": ">=0.8" } } diff --git a/test/helper.js b/test/helper.js index 77ada3bd..ac26ea48 100644 --- a/test/helper.js +++ b/test/helper.js @@ -16,11 +16,8 @@ var path = require('path'); -console.log("WAS",process.env.NODE_RED_HOME); -console.log("WAS2",__dirname); process.env.NODE_RED_HOME = process.env.NODE_RED_HOME || path.resolve(__dirname+"/../../node-red"); //console.log("HOME",process.env.NODE_RED_HOME); -console.log("PATH",path.join(process.env.NODE_RED_HOME, 'test', 'nodes', 'helper.js')); var helper = require(path.join(process.env.NODE_RED_HOME, 'test', 'nodes', 'helper.js')); try { From af17bb62da23518107b77253ce8b716a6942d8b6 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 22 Jul 2015 12:21:25 +0100 Subject: [PATCH 34/48] restore npm install --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0ccea2cf..79d35cc6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ language: node_js node_js: - "0.10" - "0.12" -#before_install: -# - npm install -g npm@~1.4.28 +before_install: + - npm install -g npm@~1.4.28 before_script: - npm install -g istanbul grunt-cli - npm install coveralls From 7bfc23b1211eedc58386131be90b39e311951962 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 22 Jul 2015 12:25:34 +0100 Subject: [PATCH 35/48] Fix path to grunt cli --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 79d35cc6..f3f63698 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +7,9 @@ before_install: before_script: - npm install -g istanbul grunt-cli - npm install coveralls - - npm install git+https://github.com/node-red/node-red.git + #- npm install git+https://github.com/node-red/node-red.git - npm install node-red - export NODE_RED_HOME=`pwd`/node_modules/node-red - (cd $NODE_RED_HOME ; npm install nock@~0.48.0) script: - - istanbul cover ./node_modules/.bin/grunt --report lcovonly && istanbul report text && ( cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js || true ) && rm -rf coverage + - istanbul cover grunt --report lcovonly && istanbul report text && ( cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js || true ) && rm -rf coverage From 3e4cb4ea1dbffe2092a6045dd7b8dbb7af28fe11 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 22 Jul 2015 12:30:01 +0100 Subject: [PATCH 36/48] Install the git repo of NR, not npm package --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3f63698..774b2101 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,7 @@ before_install: before_script: - npm install -g istanbul grunt-cli - npm install coveralls - #- npm install git+https://github.com/node-red/node-red.git - - npm install node-red + - npm install git+https://github.com/node-red/node-red.git - export NODE_RED_HOME=`pwd`/node_modules/node-red - (cd $NODE_RED_HOME ; npm install nock@~0.48.0) script: From ae469e8a72529c45f0a9431ff9f0a83248a9cac4 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 22 Jul 2015 12:36:19 +0100 Subject: [PATCH 37/48] Fix email test for i18n --- test/social/email/61-email_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/social/email/61-email_spec.js b/test/social/email/61-email_spec.js index 32c78661..411782d3 100644 --- a/test/social/email/61-email_spec.js +++ b/test/social/email/61-email_spec.js @@ -94,7 +94,7 @@ describe('email Node', function() { //console.log(logEvents); //logEvents.should.have.length(3); logEvents[0][0].should.have.a.property('msg'); - logEvents[0][0].msg.toString().should.startWith("Error: connect ECONNREFUSED"); + logEvents[0][0].msg.toString().should.startWith("email.errors.nouserid"); done(); } catch(e) { done(e); } From 285450523cce82fa716ce9a76b20cb3725a8245e Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 22 Jul 2015 13:12:30 +0100 Subject: [PATCH 38/48] Move to travis container service --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 774b2101..9a37f31c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +sudo: false language: node_js node_js: - "0.10" From e3e2df935f1b989da902006fe26b069727aed2b0 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Tue, 11 Aug 2015 19:56:23 +0100 Subject: [PATCH 39/48] fatten up rbe icon slightly --- function/rbe/icons/rbe.png | Bin 311 -> 252 bytes puball.sh | 54 +++++++++++++++++++++++++++++++++++ setenv.sh | 1 + social/dweetio/55-dweetio.js | 2 +- 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100755 puball.sh create mode 100755 setenv.sh diff --git a/function/rbe/icons/rbe.png b/function/rbe/icons/rbe.png index 52aaba977badf2f8d5dd3d7f2c83f1cd5c69a6a9..bc397210a30d8e962d2acd02cfe76ed481cbe38c 100644 GIT binary patch delta 224 zcmdna^oMbRN`xdIgG^mK6yi8%ar`fkn!2LYFK{$yrpfi3FY8#tr4NC+EBB(r|q*I}U_d!sVP zgq!1|yN6%Tf|d?_?vqoW_-xWwOky-rK6x#&eEZRuryCBOS@-PuO<}#KUJDalQ;U=( zPkOi+O`6z~qVjp0Pu9bAHcV0s(hYnECK%hSU|!yGG$g3}dzVYqm7Tjc3d~Pn&vrk+ Tlv(7|1M-HatDnm{r-UW|`W8_L delta 284 zcmV+%0ptGs0k;B>B!B)%L_t(o!|m6-E`&i8#_`{g-4KgJ6e`W?C`6(XonE7H1@6HW zxD=hv9q6d3NR$eR_>2%o;Vl$i*>~AZHs(ntPjSx7`OldtW+*BeVMV_aGjkeKy{6+P zB3^$=YV`@SiG3{A6n;Y+|g_D-v9;HaEIB5cy9vJ>H(sQLoDN^8rPVw*~|&{nu7Gynapfsu0a Date: Tue, 11 Aug 2015 19:57:54 +0100 Subject: [PATCH 40/48] Delete puball.sh --- puball.sh | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) delete mode 100755 puball.sh diff --git a/puball.sh b/puball.sh deleted file mode 100755 index 26465885..00000000 --- a/puball.sh +++ /dev/null @@ -1,54 +0,0 @@ - -cd function/random && npm publish -s && npm owner add knolleary -cd ../../function/rbe && npm publish -s && npm owner add knolleary -cd ../../function/smooth && npm publish -s && npm owner add knolleary -cd ../../social/notify && npm publish -s && npm owner add knolleary -cd ../../social/pushbullet && npm publish -s && npm owner add knolleary -#cd ../../social/snapchat && npm publish -s && npm owner add knolleary -cd ../../social/irc && npm publish -s && npm owner add knolleary -cd ../../social/pushover && npm publish -s && npm owner add knolleary -cd ../../social/twitter && npm publish -s && npm owner add knolleary -cd ../../social/xmpp && npm publish -s && npm owner add knolleary -#cd ../../social/pusher && npm publish -s && npm owner add knolleary -cd ../../social/dweetio && npm publish -s && npm owner add knolleary -cd ../../social/prowl && npm publish -s && npm owner add knolleary -cd ../../social/nma && npm publish -s && npm owner add knolleary -cd ../../social/twilio && npm publish -s && npm owner add knolleary -cd ../../hardware/blink1 && npm publish -s && npm owner add knolleary -cd ../../hardware/HummingboardGPIO && npm publish -s && npm owner add knolleary -cd ../../hardware/blinkstick && npm publish -s && npm owner add knolleary -cd ../../hardware/LEDborg && npm publish -s && npm owner add knolleary -cd ../../hardware/sensorTag && npm publish -s && npm owner add knolleary -#cd ../../hardware/scanBLE && npm publish -s && npm owner add knolleary -#cd ../../hardware/hue && npm publish -s && npm owner add knolleary -cd ../../hardware/Arduino && npm publish -s && npm owner add knolleary -cd ../../hardware/BBB && npm publish -s && npm owner add knolleary -cd ../../hardware/PiFace && npm publish -s && npm owner add knolleary -cd ../../hardware/makey && npm publish -s && npm owner add knolleary -cd ../../hardware/Pibrella && npm publish -s && npm owner add knolleary -cd ../../hardware/digiRGB && npm publish -s && npm owner add knolleary -cd ../../hardware/wemo && npm publish -s && npm owner add knolleary -cd ../../hardware/heatmiser && npm publish -s && npm owner add knolleary -cd ../../hardware/PiLiter && npm publish -s && npm owner add knolleary -cd ../../parsers/msgpack && npm publish -s && npm owner add knolleary -cd ../../parsers/base64 && npm publish -s && npm owner add knolleary -cd ../../parsers/geohash && npm publish -s && npm owner add knolleary -cd ../../parsers/what3words && npm publish -s && npm owner add knolleary -cd ../../storage/sqlite && npm publish -s && npm owner add knolleary -cd ../../storage/mongodb && npm publish -s && npm owner add knolleary -cd ../../storage/mysql && npm publish -s && npm owner add knolleary -cd ../../storage/leveldb && npm publish -s && npm owner add knolleary -cd ../../storage/redis && npm publish -s && npm owner add knolleary -cd ../../time/suncalc && npm publish -s && npm owner add knolleary -cd ../../utility/exif && npm publish -s && npm owner add knolleary -cd ../../utility/daemon && npm publish -s && npm owner add knolleary -cd ../../io/emoncms && npm publish -s && npm owner add knolleary -#cd ../../io/mqlight/&& npm publish -s && npm owner add knolleary -cd ../../io/mdns && npm publish -s && npm owner add knolleary -cd ../../io/stomp && npm publish -s && npm owner add knolleary -cd ../../io/ping && npm publish -s && npm owner add knolleary -cd ../../io/wol && npm publish -s && npm owner add knolleary -cd ../../io/serialport && npm publish -s && npm owner add knolleary -cd ../../io/snmp && npm publish -s && npm owner add knolleary -cd ../../analysis/wordpos && npm publish -s && npm owner add knolleary -cd ../../analysis/swearfilter && npm publish -s && npm owner add knolleary From 7562df3035f5c31b78302d5736a798efdf7b965e Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Tue, 11 Aug 2015 19:58:03 +0100 Subject: [PATCH 41/48] Delete setenv.sh --- setenv.sh | 1 - 1 file changed, 1 deletion(-) delete mode 100755 setenv.sh diff --git a/setenv.sh b/setenv.sh deleted file mode 100755 index ee105707..00000000 --- a/setenv.sh +++ /dev/null @@ -1 +0,0 @@ -export NODE_RED_HOME=$HOME/node-red From 56ff75a37d8195e3dd4715e721b210cf57af61b9 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Sat, 15 Aug 2015 20:00:40 +0100 Subject: [PATCH 42/48] add priority -2 to pushover node. to close #129 --- social/pushover/57-pushover.html | 2 +- social/pushover/57-pushover.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/social/pushover/57-pushover.html b/social/pushover/57-pushover.html index 40cf4732..e4638342 100644 --- a/social/pushover/57-pushover.html +++ b/social/pushover/57-pushover.html @@ -37,7 +37,7 @@
Tip: Leave title blank to set using msg.topic and msg.priority.
- Only supports priorities 2, 1, 0, and -1.
+ Supports priorities 2, 1, 0, -1, and -2. @@ -51,8 +57,9 @@ RED.nodes.registerType('pushover',{ category: 'output', defaults: { - title: {value:""}, name: {value:""}, + device: {value:""}, + title: {value:""}, priority: {value:0} }, credentials: { @@ -72,7 +79,7 @@ }, oneditprepare: function() { $("#node-input-priority").spinner({ - min:-1, + min:-2, max:2 }); } diff --git a/social/pushover/57-pushover.js b/social/pushover/57-pushover.js index 46badeed..9778e3fc 100644 --- a/social/pushover/57-pushover.js +++ b/social/pushover/57-pushover.js @@ -22,6 +22,7 @@ module.exports = function(RED) { function PushoverNode(n) { RED.nodes.createNode(this,n); this.title = n.title; + this.device = n.device; this.priority = n.priority; var credentials = this.credentials; if ((credentials) && (credentials.hasOwnProperty("pushkey"))) { this.pushkey = credentials.pushkey; } @@ -43,6 +44,7 @@ module.exports = function(RED) { this.on("input",function(msg) { var titl = this.title || msg.topic || "Node-RED"; var pri = this.priority || msg.priority || 0; + var dev = this.device || msg.device; if (isNaN(pri)) {pri=0;} if (pri > 2) {pri = 2;} if (pri < -2) {pri = -2;} @@ -58,7 +60,8 @@ module.exports = function(RED) { retry: 30, expire: 600 }; - //console.log("Sending",pushmsg); + if (dev) { pushmsg.device = dev; } + //node.log("Sending "+JSON.stringify(pushmsg)); pusher.send( pushmsg, function(err, response) { if (err) { node.error("Pushover Error: "+err); } //console.log(response); diff --git a/social/pushover/README.md b/social/pushover/README.md index 3ff18ebc..b8b6cd94 100644 --- a/social/pushover/README.md +++ b/social/pushover/README.md @@ -16,7 +16,8 @@ Usage Uses Pushover to push the msg.payload to a device that has the Pushover app installed. -Optionally uses **msg.topic** to set the title, and **msg.priority** to set the priority, if not already set in the properties. +Optionally uses **msg.topic** to set the title, **msg.device** to set the device +and **msg.priority** to set the priority, if not already set in the properties. The User-key and API-token are stored in a separate credentials file. diff --git a/social/pushover/package.json b/social/pushover/package.json index b10cb564..a3e98d44 100644 --- a/social/pushover/package.json +++ b/social/pushover/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-pushover", - "version" : "0.0.4", + "version" : "0.0.5", "description" : "A Node-RED node to send alerts via Pushover", "dependencies" : { "pushover-notifications" : "0.2.2" From 0f9bd05180f724fc3a572255e3025fd7fb20bb3b Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Thu, 27 Aug 2015 10:56:43 +0100 Subject: [PATCH 46/48] Add meg switch input to Ti Sensortag node --- hardware/sensorTag/79-sensorTag.js | 4 ++-- hardware/sensorTag/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hardware/sensorTag/79-sensorTag.js b/hardware/sensorTag/79-sensorTag.js index 191454e9..77c229bb 100644 --- a/hardware/sensorTag/79-sensorTag.js +++ b/hardware/sensorTag/79-sensorTag.js @@ -84,9 +84,9 @@ module.exports = function(RED) { msg.payload = {'x': +x.toFixed(2), 'y': +y.toFixed(2), 'z': +z.toFixed(2)}; node.send(msg); }); - sensorTag.on('simpleKeyChange', function(left, right) { + sensorTag.on('simpleKeyChange', function(left, right, mag) { var msg = {'topic': node.topic + '/keys'}; - msg.payload = {'left': left, 'right': right}; + msg.payload = {'left': left, 'right': right, 'magnet': mag}; node.send(msg); }); diff --git a/hardware/sensorTag/package.json b/hardware/sensorTag/package.json index d0beff8d..5f02f019 100644 --- a/hardware/sensorTag/package.json +++ b/hardware/sensorTag/package.json @@ -1,10 +1,10 @@ { "name": "node-red-node-sensortag", "description": "A Node-RED node to read data from a TI SensorTag", - "version": "0.0.6", + "version": "0.0.7", "keywords" : ["node-red","sensortag"], "dependencies": { - "sensortag": "~1.0.1" + "sensortag": "~1.1.0" }, "license": "Apache-2.0", "repository" : { From 059c7a2d67778badbd577289ae37f0eb26e67ca2 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 2 Sep 2015 10:56:32 +0100 Subject: [PATCH 47/48] slight update to daemon node words to clarify arguments --- utility/daemon/README.md | 23 +++++++++++++++++------ utility/daemon/daemon.html | 4 +++- utility/daemon/package.json | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/utility/daemon/README.md b/utility/daemon/README.md index 32bba0c4..2ed00f2b 100644 --- a/utility/daemon/README.md +++ b/utility/daemon/README.md @@ -1,9 +1,12 @@ node-red-node-daemon ==================== -A Node-RED node that runs and monitors a long running system command. +A Node-RED node that runs and +monitors a long running system command. -Similar to the **exec** node - but this calls the command at start time and then pipes any input to the node to the STDIN of the running command, and feeds any STDOUT to the first output. +Similar to the **exec** node - but this calls the command at start time and +then pipes any input to the node to the STDIN of the running command, and feeds +any STDOUT to the first output. Useful for monitoring command line based processes. @@ -20,10 +23,18 @@ Usage Calls out to a long running system command. Sends msg.payload to stdin of the process. -Provides 3 outputs... stdout, stderr, and return code, from the running command. +**Note** Only the command itself should be placed in the command field. +All parameters **must** be placed in the arguments field. -If the called program stops (i.e. a return code is produced), this node can attempt to restart the command. +The command provides 3 outputs... stdout, stderr, and return code, from the running command. -**Note :** when you stop Node-RED running we may not get a chance to kill the called program so it may remain running. You may have to kill it manually. +If the called program stops (i.e. a return code is produced), this node can attempt +to restart the command automatically. -For example I have used it to run and then monitor the dump1090 plane spotter, and also to interact with various python apps that everyone seem to write these days :-) +**Note :** when you stop Node-RED running we may not get a chance to kill the +called program so it may remain running. You may have to kill it manually. + +For example it can be used to run and then monitor the +dump1090 plane +spotter, and also to interact with various python apps that everyone seem to write +these days :-) diff --git a/utility/daemon/daemon.html b/utility/daemon/daemon.html index dc32f07d..b6b17d5c 100644 --- a/utility/daemon/daemon.html +++ b/utility/daemon/daemon.html @@ -20,7 +20,7 @@
- +
@@ -45,6 +45,8 @@
+
Note: The command should just be the actual command. + All parameters should be passed in as arguments.