From 38d16b8a4d6a2618b08b737a9c2860ee8cbb1134 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 12 Apr 2017 13:32:08 +0100 Subject: [PATCH] Tidy up listing for some nodes. No functional changes to make listing task pass --- .jscsrc | 2 +- Gruntfile.js | 2 +- hardware/sensehat/sensehat.js | 10 +++++----- hardware/sensehatsim/sensehatsim.js | 14 +++++++------- hardware/wemo/WeMoNG.js | 8 ++++---- package.json | 22 +++++++++++----------- social/pushbullet/57-pushbullet.js | 2 +- social/twitter/27-twitter.js | 4 ++-- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.jscsrc b/.jscsrc index 58f11080..28abb3b7 100644 --- a/.jscsrc +++ b/.jscsrc @@ -20,5 +20,5 @@ "requireSpacesInFunction": { "beforeOpeningCurlyBrace": true }, //"validateParameterSeparator": ", ", //"validateQuoteMarks": false, - "maximumLineLength": 220 + "maximumLineLength": 280 } diff --git a/Gruntfile.js b/Gruntfile.js index e516bfc5..5e5d24f9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -29,7 +29,7 @@ module.exports = function(grunt) { }, }, inlinelint: { - html: ['*/*/*.html'], + html: ['*/*/*.html', '!node_modules/*'], options: { jshintrc: ".jshintrc" //,reporter: require('jshint-stylish') diff --git a/hardware/sensehat/sensehat.js b/hardware/sensehat/sensehat.js index f2dfec03..67179233 100644 --- a/hardware/sensehat/sensehat.js +++ b/hardware/sensehat/sensehat.js @@ -52,7 +52,7 @@ module.exports = function(RED) { } buffer = lines.pop(); var m,msg; - for (var i=0;i 0) { var pixels = {}; var rules = []; - for (i=expanded.length-1;i>=0;i--) { + for (i=expanded.length-1; i>=0; i--) { var rule = expanded[i]; if (!pixels[rule[0]+","+rule[1]]) { rules.unshift(rule.join(",")); diff --git a/hardware/sensehatsim/sensehatsim.js b/hardware/sensehatsim/sensehatsim.js index c667964a..bcdb8cd6 100644 --- a/hardware/sensehatsim/sensehatsim.js +++ b/hardware/sensehatsim/sensehatsim.js @@ -42,9 +42,9 @@ module.exports = function(RED) { currentFlipV = false; currentRotation = "R0"; currentDisplay = []; - for (var y=0;y<8;y++) { + for (var y=0; y<8; y++) { currentDisplay.push([]); - for (var x=0;x<8;x++) { + for (var x=0; x<8; x++) { currentDisplay[y].push('0,0,0'); } } @@ -80,8 +80,8 @@ module.exports = function(RED) { socket.send("FH"); } var cmd = ""; - for (var y=0;y<8;y++) { - for (var x=0;x<8;x++) { + for (var y=0; y<8; y++) { + for (var x=0; x<8; x++) { cmd += ","+x+","+y+","+currentDisplay[y][x]; } } @@ -110,7 +110,7 @@ module.exports = function(RED) { topic: "joystick", payload: {key: KEY_MAP[m[1]], state: Number(m[2])} } - for (var j=0;j 0) { var pixels = {}; var rules = []; - for (i=expanded.length-1;i>=0;i--) { + for (i=expanded.length-1; i>=0; i--) { var rule = expanded[i]; if (!pixels[rule[0]+","+rule[1]]) { rules.unshift(rule.join(",")); diff --git a/hardware/wemo/WeMoNG.js b/hardware/wemo/WeMoNG.js index 96ccbf7c..1676fb94 100644 --- a/hardware/wemo/WeMoNG.js +++ b/hardware/wemo/WeMoNG.js @@ -283,7 +283,7 @@ module.exports = function(RED) { wemo.toggleSocket(dev, on); } else if (dev.type === 'light') { wemo.setStatus(dev,capability, on); - } else { + } else { //console.log('group'); wemo.setStatus(dev, capability, on); } @@ -376,7 +376,7 @@ module.exports = function(RED) { }; RED.nodes.registerType('wemo in', wemoNGEvent); - var wemoNGLookup = function(n){ + var wemoNGLookup = function(n) { RED.nodes.createNode(this,n); var node = this; node.device = n.device; @@ -408,7 +408,7 @@ module.exports = function(RED) { if (dev.type === 'light' || dev.type === 'group') { //console.log("light"); wemo.getLightStatus(dev) - .then(function(status){ + .then(function(status) { // if (status.available) { var caps = status.capabilities.split(','); var vals = status.state.split(','); @@ -430,7 +430,7 @@ module.exports = function(RED) { console.log("socket"); //socket wemo.getSocketStatus(dev) - .then(function(status){ + .then(function(status) { msg.payload = { state: status }; diff --git a/package.json b/package.json index a6cbec9e..c747b0ca 100644 --- a/package.json +++ b/package.json @@ -17,24 +17,24 @@ "Node-RED", "nodes", "iot", "ibm", "flow" ], "devDependencies": { - "grunt": "^0.4.5", - "grunt-simple-mocha": "^0.4.1", - "grunt-contrib-jshint": "^1.0.0", - "grunt-lint-inline": "^0.4.4", + "grunt": "^1.0.1", + "grunt-contrib-jshint": "^1.1.0", "grunt-jscs": "^2.8.0", + "grunt-lint-inline": "^1.0.0", + "grunt-simple-mocha": "^0.4.1", "mocha": "^2.4.5", - "should": "^8.3.1", - "sinon": "^1.17.3", + "should": "^8.4.0", + "sinon": "^1.17.7", "supertest": "^1.2.0", - "proxyquire": "^1.7.10", - "pushbullet": "^1.4.3", - "when": "^3.7.7", + "proxyquire": "^1.7.11", + "pushbullet": "^2.0.0", + "when": "^3.7.8", "exif": "^0.6.0", "ngeohash": "^0.6.0", "nodemailer" : "^1.11.0", "poplib" : "^0.1.7", - "mailparser" : "^0.6.1", - "imap" : "^0.8.18", + "mailparser" : "^0.6.2", + "imap" : "^0.8.19", "msgpack-js": "^0.3.0" }, "engines": { diff --git a/social/pushbullet/57-pushbullet.js b/social/pushbullet/57-pushbullet.js index 7b7bd60a..ec5ee553 100644 --- a/social/pushbullet/57-pushbullet.js +++ b/social/pushbullet/57-pushbullet.js @@ -165,7 +165,7 @@ module.exports = function(RED) { resolve(last); return onError(err); } - for (var i=0;i=0;t-=1) { + for (var t=cb.length-1; t>=0; t-=1) { var tweet = cb[t]; var where = tweet.sender.location; var la = tweet.lang || tweet.sender.lang; @@ -370,7 +370,7 @@ module.exports = function(RED) { this.stream.destroy(); } if (this.poll_ids) { - for (var i=0;i