mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Tidy up listing for some nodes. No functional changes
to make listing task pass
This commit is contained in:
parent
8abfd4841d
commit
38d16b8a4d
2
.jscsrc
2
.jscsrc
@ -20,5 +20,5 @@
|
||||
"requireSpacesInFunction": { "beforeOpeningCurlyBrace": true },
|
||||
//"validateParameterSeparator": ", ",
|
||||
//"validateQuoteMarks": false,
|
||||
"maximumLineLength": 220
|
||||
"maximumLineLength": 280
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ module.exports = function(grunt) {
|
||||
},
|
||||
},
|
||||
inlinelint: {
|
||||
html: ['*/*/*.html'],
|
||||
html: ['*/*/*.html', '!node_modules/*'],
|
||||
options: {
|
||||
jshintrc: ".jshintrc"
|
||||
//,reporter: require('jshint-stylish')
|
||||
|
@ -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(","));
|
||||
|
@ -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(","));
|
||||
|
@ -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
|
||||
};
|
||||
|
22
package.json
22
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": {
|
||||
|
@ -165,7 +165,7 @@ module.exports = function(RED) {
|
||||
resolve(last);
|
||||
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]);
|
||||
}
|
||||
try {
|
||||
|
@ -156,7 +156,7 @@ module.exports = function(RED) {
|
||||
since_id:node.since_id
|
||||
},function(err,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 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<this.poll_ids.length;i++) {
|
||||
for (var i=0; i<this.poll_ids.length; i++) {
|
||||
clearInterval(this.poll_ids[i]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user