Tidy up listing for some nodes. No functional changes

to make listing task pass
This commit is contained in:
Dave Conway-Jones 2017-04-12 13:32:08 +01:00
parent 8abfd4841d
commit 38d16b8a4d
No known key found for this signature in database
GPG Key ID: 81B04231572A9A2D
8 changed files with 32 additions and 32 deletions

View File

@ -20,5 +20,5 @@
"requireSpacesInFunction": { "beforeOpeningCurlyBrace": true }, "requireSpacesInFunction": { "beforeOpeningCurlyBrace": true },
//"validateParameterSeparator": ", ", //"validateParameterSeparator": ", ",
//"validateQuoteMarks": false, //"validateQuoteMarks": false,
"maximumLineLength": 220 "maximumLineLength": 280
} }

View File

@ -29,7 +29,7 @@ module.exports = function(grunt) {
}, },
}, },
inlinelint: { inlinelint: {
html: ['*/*/*.html'], html: ['*/*/*.html', '!node_modules/*'],
options: { options: {
jshintrc: ".jshintrc" jshintrc: ".jshintrc"
//,reporter: require('jshint-stylish') //,reporter: require('jshint-stylish')

View File

@ -52,7 +52,7 @@ module.exports = function(RED) {
} }
buffer = lines.pop(); buffer = lines.pop();
var m,msg; var m,msg;
for (var i=0;i<lines.length;i++) { for (var i=0; i<lines.length; i++) {
var line = lines[i]; var line = lines[i];
msg = null; msg = null;
if ((m = KEY_RE.exec(line)) !== null) { if ((m = KEY_RE.exec(line)) !== null) {
@ -90,7 +90,7 @@ module.exports = function(RED) {
} }
} }
if (msg && !onclose) { if (msg && !onclose) {
for (var j=0;j<users.length;j++) { for (var j=0; j<users.length; j++) {
var node = users[j]; var node = users[j];
if (node.motion && msg.topic === "motion") { if (node.motion && msg.topic === "motion") {
node.send(RED.util.cloneMessage(msg)); node.send(RED.util.cloneMessage(msg));
@ -322,9 +322,9 @@ module.exports = function(RED) {
} }
} }
x = x0; x = x0;
while(x<=x1) { while (x<=x1) {
y = y0; y = y0;
while(y<=y1) { while (y<=y1) {
expanded.push([x,y,col]); expanded.push([x,y,col]);
y++; y++;
} }
@ -334,7 +334,7 @@ module.exports = function(RED) {
if (expanded.length > 0) { if (expanded.length > 0) {
var pixels = {}; var pixels = {};
var rules = []; var rules = [];
for (i=expanded.length-1;i>=0;i--) { for (i=expanded.length-1; i>=0; i--) {
var rule = expanded[i]; var rule = expanded[i];
if (!pixels[rule[0]+","+rule[1]]) { if (!pixels[rule[0]+","+rule[1]]) {
rules.unshift(rule.join(",")); rules.unshift(rule.join(","));

View File

@ -42,9 +42,9 @@ module.exports = function(RED) {
currentFlipV = false; currentFlipV = false;
currentRotation = "R0"; currentRotation = "R0";
currentDisplay = []; currentDisplay = [];
for (var y=0;y<8;y++) { for (var y=0; y<8; y++) {
currentDisplay.push([]); currentDisplay.push([]);
for (var x=0;x<8;x++) { for (var x=0; x<8; x++) {
currentDisplay[y].push('0,0,0'); currentDisplay[y].push('0,0,0');
} }
} }
@ -80,8 +80,8 @@ module.exports = function(RED) {
socket.send("FH"); socket.send("FH");
} }
var cmd = ""; var cmd = "";
for (var y=0;y<8;y++) { for (var y=0; y<8; y++) {
for (var x=0;x<8;x++) { for (var x=0; x<8; x++) {
cmd += ","+x+","+y+","+currentDisplay[y][x]; cmd += ","+x+","+y+","+currentDisplay[y][x];
} }
} }
@ -110,7 +110,7 @@ module.exports = function(RED) {
topic: "joystick", topic: "joystick",
payload: {key: KEY_MAP[m[1]], state: Number(m[2])} payload: {key: KEY_MAP[m[1]], state: Number(m[2])}
} }
for (var j=0;j<users.length;j++) { for (var j=0; j<users.length; j++) {
var node = users[j]; var node = users[j];
if (node.stick) { if (node.stick) {
node.send(RED.util.cloneMessage(msg)); node.send(RED.util.cloneMessage(msg));
@ -168,7 +168,7 @@ module.exports = function(RED) {
topic: "environment", topic: "environment",
payload: {temperature: currentEnvironment.temperature, humidity: currentEnvironment.humidity, pressure: currentEnvironment.pressure} payload: {temperature: currentEnvironment.temperature, humidity: currentEnvironment.humidity, pressure: currentEnvironment.pressure}
}; };
for (var j=0;j<users.length;j++) { for (var j=0; j<users.length; j++) {
var node = users[j]; var node = users[j];
if (node.env) { if (node.env) {
node.send(RED.util.cloneMessage(msg)); node.send(RED.util.cloneMessage(msg));
@ -332,7 +332,7 @@ module.exports = function(RED) {
if (expanded.length > 0) { if (expanded.length > 0) {
var pixels = {}; var pixels = {};
var rules = []; var rules = [];
for (i=expanded.length-1;i>=0;i--) { for (i=expanded.length-1; i>=0; i--) {
var rule = expanded[i]; var rule = expanded[i];
if (!pixels[rule[0]+","+rule[1]]) { if (!pixels[rule[0]+","+rule[1]]) {
rules.unshift(rule.join(",")); rules.unshift(rule.join(","));

View File

@ -376,7 +376,7 @@ module.exports = function(RED) {
}; };
RED.nodes.registerType('wemo in', wemoNGEvent); RED.nodes.registerType('wemo in', wemoNGEvent);
var wemoNGLookup = function(n){ var wemoNGLookup = function(n) {
RED.nodes.createNode(this,n); RED.nodes.createNode(this,n);
var node = this; var node = this;
node.device = n.device; node.device = n.device;
@ -408,7 +408,7 @@ module.exports = function(RED) {
if (dev.type === 'light' || dev.type === 'group') { if (dev.type === 'light' || dev.type === 'group') {
//console.log("light"); //console.log("light");
wemo.getLightStatus(dev) wemo.getLightStatus(dev)
.then(function(status){ .then(function(status) {
// if (status.available) { // if (status.available) {
var caps = status.capabilities.split(','); var caps = status.capabilities.split(',');
var vals = status.state.split(','); var vals = status.state.split(',');
@ -430,7 +430,7 @@ module.exports = function(RED) {
console.log("socket"); console.log("socket");
//socket //socket
wemo.getSocketStatus(dev) wemo.getSocketStatus(dev)
.then(function(status){ .then(function(status) {
msg.payload = { msg.payload = {
state: status state: status
}; };

View File

@ -17,24 +17,24 @@
"Node-RED", "nodes", "iot", "ibm", "flow" "Node-RED", "nodes", "iot", "ibm", "flow"
], ],
"devDependencies": { "devDependencies": {
"grunt": "^0.4.5", "grunt": "^1.0.1",
"grunt-simple-mocha": "^0.4.1", "grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-jshint": "^1.0.0",
"grunt-lint-inline": "^0.4.4",
"grunt-jscs": "^2.8.0", "grunt-jscs": "^2.8.0",
"grunt-lint-inline": "^1.0.0",
"grunt-simple-mocha": "^0.4.1",
"mocha": "^2.4.5", "mocha": "^2.4.5",
"should": "^8.3.1", "should": "^8.4.0",
"sinon": "^1.17.3", "sinon": "^1.17.7",
"supertest": "^1.2.0", "supertest": "^1.2.0",
"proxyquire": "^1.7.10", "proxyquire": "^1.7.11",
"pushbullet": "^1.4.3", "pushbullet": "^2.0.0",
"when": "^3.7.7", "when": "^3.7.8",
"exif": "^0.6.0", "exif": "^0.6.0",
"ngeohash": "^0.6.0", "ngeohash": "^0.6.0",
"nodemailer" : "^1.11.0", "nodemailer" : "^1.11.0",
"poplib" : "^0.1.7", "poplib" : "^0.1.7",
"mailparser" : "^0.6.1", "mailparser" : "^0.6.2",
"imap" : "^0.8.18", "imap" : "^0.8.19",
"msgpack-js": "^0.3.0" "msgpack-js": "^0.3.0"
}, },
"engines": { "engines": {

View File

@ -165,7 +165,7 @@ module.exports = function(RED) {
resolve(last); resolve(last);
return onError(err); return onError(err);
} }
for (var i=0;i<res.pushes.length; i++) { for (var i=0; i<res.pushes.length; i++) {
self.pushMsg(res.pushes[i]); self.pushMsg(res.pushes[i]);
} }
try { try {

View File

@ -156,7 +156,7 @@ module.exports = function(RED) {
since_id:node.since_id since_id:node.since_id
},function(err,cb) { },function(err,cb) {
if (cb) { if (cb) {
for (var t=cb.length-1;t>=0;t-=1) { for (var t=cb.length-1; t>=0; t-=1) {
var tweet = cb[t]; var tweet = cb[t];
var where = tweet.sender.location; var where = tweet.sender.location;
var la = tweet.lang || tweet.sender.lang; var la = tweet.lang || tweet.sender.lang;
@ -370,7 +370,7 @@ module.exports = function(RED) {
this.stream.destroy(); this.stream.destroy();
} }
if (this.poll_ids) { if (this.poll_ids) {
for (var i=0;i<this.poll_ids.length;i++) { for (var i=0; i<this.poll_ids.length; i++) {
clearInterval(this.poll_ids[i]); clearInterval(this.poll_ids[i]);
} }
} }