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
8 changed files with 32 additions and 32 deletions

View File

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

View File

@@ -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<users.length;j++) {
for (var j=0; j<users.length; j++) {
var node = users[j];
if (node.stick) {
node.send(RED.util.cloneMessage(msg));
@@ -168,7 +168,7 @@ module.exports = function(RED) {
topic: "environment",
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];
if (node.env) {
node.send(RED.util.cloneMessage(msg));
@@ -332,7 +332,7 @@ module.exports = function(RED) {
if (expanded.length > 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(","));

View File

@@ -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
};