mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Update node-red-nodes - clean up lint issues (mainly unused funcs and vars)
This commit is contained in:
parent
1e7717ac8a
commit
bb9d67f1ae
@ -153,7 +153,7 @@ voltage ten times in rapid succession for each input message and output the mean
|
|||||||
// Handle resizing the Input Scaling div when the dialog is resized - this isn't quite right!
|
// Handle resizing the Input Scaling div when the dialog is resized - this isn't quite right!
|
||||||
function switchDialogResize(ev, ui) {
|
function switchDialogResize(ev, ui) {
|
||||||
$("#node-input-breakpoint-container-div").css("height", (ui.size.height - 299) + "px");
|
$("#node-input-breakpoint-container-div").css("height", (ui.size.height - 299) + "px");
|
||||||
};
|
}
|
||||||
|
|
||||||
$("#dialog").on("dialogresize", switchDialogResize);
|
$("#dialog").on("dialogresize", switchDialogResize);
|
||||||
$("#dialog").one("dialogopen", function (ev) {
|
$("#dialog").one("dialogopen", function (ev) {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
module.exports = function(RED) {
|
module.exports = function(RED) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var util = require("util");
|
var util = require("util");
|
||||||
var exec = require('child_process').exec;
|
//var exec = require('child_process').exec;
|
||||||
var spawn = require('child_process').spawn;
|
var spawn = require('child_process').spawn;
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ module.exports = function(RED) {
|
|||||||
if (RED.settings.verbose) { node.log("err: "+data+" :"); }
|
if (RED.settings.verbose) { node.log("err: "+data+" :"); }
|
||||||
});
|
});
|
||||||
|
|
||||||
node.child.on('close', function (code) {
|
node.child.on('close', function () {
|
||||||
node.child = null;
|
node.child = null;
|
||||||
node.running = false;
|
node.running = false;
|
||||||
node.status({fill:"red",shape:"circle",text:""});
|
node.status({fill:"red",shape:"circle",text:""});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-ledborg",
|
"name" : "node-red-node-ledborg",
|
||||||
"version" : "0.0.5",
|
"version" : "0.0.6",
|
||||||
"description" : "A Node-RED node to control a PiBorg LedBorg board for a Raspberry Pi.",
|
"description" : "A Node-RED node to control a PiBorg LedBorg board for a Raspberry Pi.",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
},
|
},
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
module.exports = function(RED) {
|
module.exports = function(RED) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var util = require("util");
|
var util = require("util");
|
||||||
var exec = require('child_process').exec;
|
|
||||||
var spawn = require('child_process').spawn;
|
var spawn = require('child_process').spawn;
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-piliter",
|
"name" : "node-red-node-piliter",
|
||||||
"version" : "0.0.4",
|
"version" : "0.0.5",
|
||||||
"description" : "A Node-RED node to drive a Raspberry Pi Pi-LITEr 8 LED board.",
|
"description" : "A Node-RED node to drive a Raspberry Pi Pi-LITEr 8 LED board.",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
},
|
},
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
module.exports = function(RED) {
|
module.exports = function(RED) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var util = require("util");
|
var util = require("util");
|
||||||
var exec = require('child_process').exec;
|
|
||||||
var spawn = require('child_process').spawn;
|
var spawn = require('child_process').spawn;
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-pibrella",
|
"name" : "node-red-node-pibrella",
|
||||||
"version" : "0.0.6",
|
"version" : "0.0.7",
|
||||||
"description" : "A Node-RED node to read from and write to a Pibrella Raspberry Pi add-on board",
|
"description" : "A Node-RED node to read from and write to a Pibrella Raspberry Pi add-on board",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
},
|
},
|
||||||
|
@ -129,7 +129,7 @@ module.exports = function(RED) {
|
|||||||
|
|
||||||
if (typeof(err.name) === 'undefined' || err.name !== 'ReferenceError') {
|
if (typeof(err.name) === 'undefined' || err.name !== 'ReferenceError') {
|
||||||
//USB error occurred when BlinkStick was animating
|
//USB error occurred when BlinkStick was animating
|
||||||
node.led.close(function (err) {
|
node.led.close(function () {
|
||||||
node.led = undefined;
|
node.led = undefined;
|
||||||
findBlinkStick();
|
findBlinkStick();
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-blinkstick",
|
"name" : "node-red-node-blinkstick",
|
||||||
"version" : "0.1.5",
|
"version" : "0.1.6",
|
||||||
"description" : "A Node-RED node to control a Blinkstick",
|
"description" : "A Node-RED node to control a Blinkstick",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"blinkstick" : "1.1.*"
|
"blinkstick" : "1.1.*"
|
||||||
|
@ -145,7 +145,7 @@
|
|||||||
password: {type: "password"}
|
password: {type: "password"}
|
||||||
},
|
},
|
||||||
label: function() {
|
label: function() {
|
||||||
if (this.service == "") {
|
if (this.service === "") {
|
||||||
this.service = "localhost";
|
this.service = "localhost";
|
||||||
}
|
}
|
||||||
return (this.clientid ? this.clientid + "@" : "") + this.service;
|
return (this.clientid ? this.clientid + "@" : "") + this.service;
|
||||||
|
@ -38,9 +38,9 @@ module.exports = function(RED) {
|
|||||||
ex.stdout.on('data', function (data) {
|
ex.stdout.on('data', function (data) {
|
||||||
line += data.toString();
|
line += data.toString();
|
||||||
});
|
});
|
||||||
ex.stderr.on('data', function (data) {
|
//ex.stderr.on('data', function (data) {
|
||||||
//console.log('[ping] stderr: ' + data);
|
//console.log('[ping] stderr: ' + data);
|
||||||
});
|
//});
|
||||||
ex.on('close', function (code) {
|
ex.on('close', function (code) {
|
||||||
var m = regex.exec(line)||"";
|
var m = regex.exec(line)||"";
|
||||||
if (m !== '') {
|
if (m !== '') {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-ping",
|
"name" : "node-red-node-ping",
|
||||||
"version" : "0.0.4",
|
"version" : "0.0.5",
|
||||||
"description" : "A Node-RED node to ping a remote server, for use as a keep-alive check.",
|
"description" : "A Node-RED node to ping a remote server, for use as a keep-alive check.",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
},
|
},
|
||||||
|
@ -138,7 +138,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
getName(this.credentials.deviceid);
|
getName(this.credentials.deviceid);
|
||||||
}
|
}
|
||||||
catch(err) {
|
catch(err) {
|
||||||
@ -164,8 +164,8 @@
|
|||||||
function updateDeviceList() {
|
function updateDeviceList() {
|
||||||
if(!ddConfig.val()) {
|
if(!ddConfig.val()) {
|
||||||
ddDevice.children().remove();
|
ddDevice.children().remove();
|
||||||
ddDevice.append('<option value="">All</option>')
|
ddDevice.append('<option value="">All</option>');
|
||||||
ddDevice.append('<option value="_msg_">- set from msg.deviceid -</option>')
|
ddDevice.append('<option value="_msg_">- set from msg.deviceid -</option>');
|
||||||
var currentDevice;
|
var currentDevice;
|
||||||
if(node.credentials) {
|
if(node.credentials) {
|
||||||
currentDevice = node.credentials.deviceid;
|
currentDevice = node.credentials.deviceid;
|
||||||
@ -176,15 +176,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var config = RED.nodes.node(ddConfig.val()),
|
var config = RED.nodes.node(ddConfig.val()),
|
||||||
url = 'pushbullet/'+ddConfig.val()+'/devices';
|
url = 'pushbullet/'+ddConfig.val()+'/devices';
|
||||||
if(config && config.credentials && config.credentials.apikey) {
|
if(config && config.credentials && config.credentials.apikey) {
|
||||||
url += '?apikey='+config.credentials.apikey;
|
url += '?apikey='+config.credentials.apikey;
|
||||||
}
|
}
|
||||||
$.getJSON(url, function(data) {
|
$.getJSON(url, function(data) {
|
||||||
ddDevice.children().remove();
|
ddDevice.children().remove();
|
||||||
ddDevice.append('<option value="">All</option>')
|
ddDevice.append('<option value="">All</option>');
|
||||||
ddDevice.append('<option value="_msg_">- set from msg.deviceid -</option>')
|
ddDevice.append('<option value="_msg_">- set from msg.deviceid -</option>');
|
||||||
var currentDevice, addCurrent = true;
|
var currentDevice, addCurrent = true;
|
||||||
if(node.credentials) {
|
if(node.credentials) {
|
||||||
currentDevice = node.credentials.deviceid;
|
currentDevice = node.credentials.deviceid;
|
||||||
@ -203,7 +203,7 @@
|
|||||||
}
|
}
|
||||||
ddDevice.val(currentDevice);
|
ddDevice.val(currentDevice);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,7 +292,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/x-red" data-help-name="pushbullet in">
|
<script type="text/x-red" data-help-name="pushbullet in">
|
||||||
<p>Receives Pushbullets from all devices. Messages contain the following data:</p>
|
<p>Receives Pushbullets from all devices. Messages contain the following data:</p>
|
||||||
<p><code>msg.pushtype</code>: type of message</p>
|
<p><code>msg.pushtype</code>: type of message</p>
|
||||||
<p><code>msg.topic</code>: topic information from the push</p>
|
<p><code>msg.topic</code>: topic information from the push</p>
|
||||||
@ -326,7 +326,7 @@
|
|||||||
var node = this, ddConfig = $('#node-input-config'), ddDevice = $('#node-input-filters');
|
var node = this, ddConfig = $('#node-input-config'), ddDevice = $('#node-input-filters');
|
||||||
|
|
||||||
function updateDeviceList() {
|
function updateDeviceList() {
|
||||||
var config = RED.nodes.node(ddConfig.val()),
|
var config = RED.nodes.node(ddConfig.val()),
|
||||||
url = 'pushbullet/'+ddConfig.val()+'/devices';
|
url = 'pushbullet/'+ddConfig.val()+'/devices';
|
||||||
if(config && config.credentials && config.credentials.apikey) {
|
if(config && config.credentials && config.credentials.apikey) {
|
||||||
url += '?apikey='+config.credentials.apikey;
|
url += '?apikey='+config.credentials.apikey;
|
||||||
@ -343,7 +343,7 @@
|
|||||||
for(var i=0; i<data.length; i++) {
|
for(var i=0; i<data.length; i++) {
|
||||||
var dev = data[i];
|
var dev = data[i];
|
||||||
ddDevice.append('<option value="'+dev.iden+'">'+dev.nickname+' ('+dev.kind+')</option>');
|
ddDevice.append('<option value="'+dev.iden+'">'+dev.nickname+' ('+dev.kind+')</option>');
|
||||||
|
|
||||||
idx = addDevices.indexOf(dev.iden);
|
idx = addDevices.indexOf(dev.iden);
|
||||||
if (idx > -1) {
|
if (idx > -1) {
|
||||||
addDevices.splice(idx, 1);
|
addDevices.splice(idx, 1);
|
||||||
@ -354,7 +354,7 @@
|
|||||||
ddDevice.append('<option value="'+addDevices[j]+'">'+addDevices[j]+'</option>');
|
ddDevice.append('<option value="'+addDevices[j]+'">'+addDevices[j]+'</option>');
|
||||||
}
|
}
|
||||||
ddDevice.val(currentDevices);
|
ddDevice.val(currentDevices);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ddConfig.change(function() {
|
ddConfig.change(function() {
|
||||||
|
@ -153,8 +153,8 @@
|
|||||||
$("#node-input-credentials-row").hide();
|
$("#node-input-credentials-row").hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.twilioType == null) {
|
if (this.twilioType === null) {
|
||||||
if (this.url == "") {
|
if (this.url === "") {
|
||||||
this.twilioType = "call";
|
this.twilioType = "call";
|
||||||
} else {
|
} else {
|
||||||
this.twilioType = "sms";
|
this.twilioType = "sms";
|
||||||
|
@ -18,9 +18,6 @@ module.exports = function(RED) {
|
|||||||
"use strict";
|
"use strict";
|
||||||
var XMPP = require('simple-xmpp');
|
var XMPP = require('simple-xmpp');
|
||||||
|
|
||||||
try { var xmppkey = RED.settings.xmpp || require(process.env.NODE_RED_HOME+"/../xmppkeys.js"); }
|
|
||||||
catch(err) { }
|
|
||||||
|
|
||||||
function XMPPServerNode(n) {
|
function XMPPServerNode(n) {
|
||||||
RED.nodes.createNode(this,n);
|
RED.nodes.createNode(this,n);
|
||||||
this.server = n.server;
|
this.server = n.server;
|
||||||
@ -73,7 +70,7 @@ function XmppInNode(n) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
xmpp.on('groupchat', function(conference, from, message, stamp) {
|
xmpp.on('groupchat', function(conference, from, message, stamp) {
|
||||||
var msg = { topic:from, payload:message, room:conference };
|
var msg = { topic:from, payload:message, room:conference, ts:stamp };
|
||||||
if (from != node.nick) { node.send([msg,null]); }
|
if (from != node.nick) { node.send([msg,null]); }
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -93,7 +90,7 @@ function XmppInNode(n) {
|
|||||||
console.error("error",err);
|
console.error("error",err);
|
||||||
});
|
});
|
||||||
|
|
||||||
xmpp.on('close', function(err) {
|
xmpp.on('close', function() {
|
||||||
node.log('connection closed');
|
node.log('connection closed');
|
||||||
node.status({fill:"red",shape:"ring",text:"not connected"});
|
node.status({fill:"red",shape:"ring",text:"not connected"});
|
||||||
});
|
});
|
||||||
@ -157,7 +154,7 @@ function XmppOutNode(n) {
|
|||||||
console.error("error",err);
|
console.error("error",err);
|
||||||
});
|
});
|
||||||
|
|
||||||
xmpp.on('close', function(err) {
|
xmpp.on('close', function() {
|
||||||
node.log('connection closed');
|
node.log('connection closed');
|
||||||
node.status({fill:"red",shape:"ring",text:"not connected"});
|
node.status({fill:"red",shape:"ring",text:"not connected"});
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-xmpp",
|
"name" : "node-red-node-xmpp",
|
||||||
"version" : "0.0.4",
|
"version" : "0.0.5",
|
||||||
"description" : "A Node-RED node to talk to an XMPP server",
|
"description" : "A Node-RED node to talk to an XMPP server",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"simple-xmpp" : "0.1.92"
|
"simple-xmpp" : "0.1.92"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name" : "node-red-node-sqlite",
|
"name" : "node-red-node-sqlite",
|
||||||
"version" : "0.0.5",
|
"version" : "0.0.6",
|
||||||
"description" : "A sqlite node for Node-RED",
|
"description" : "A sqlite node for Node-RED",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"sqlite3" : "3.0.*"
|
"sqlite3" : "3.0.*"
|
||||||
|
@ -27,13 +27,12 @@ module.exports = function(RED) {
|
|||||||
|
|
||||||
node.doConnect = function() {
|
node.doConnect = function() {
|
||||||
node.db = new sqlite3.Database(node.dbname);
|
node.db = new sqlite3.Database(node.dbname);
|
||||||
node.db.on('open',function(err) {
|
node.db.on('open', function() {
|
||||||
if (node.tick) { clearTimeout(node.tick); }
|
if (node.tick) { clearTimeout(node.tick); }
|
||||||
node.log("opened "+node.dbname+" ok");
|
node.log("opened "+node.dbname+" ok");
|
||||||
});
|
});
|
||||||
node.db.on('error', function(err) {
|
node.db.on('error', function(err) {
|
||||||
node.error(err);
|
node.error("failed to open "+node.dbname, err);
|
||||||
node.log("failed to open "+node.dbname);
|
|
||||||
node.tick = setTimeout(function() { node.doConnect(); }, reconnect);
|
node.tick = setTimeout(function() { node.doConnect(); }, reconnect);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user