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!
|
||||
function switchDialogResize(ev, ui) {
|
||||
$("#node-input-breakpoint-container-div").css("height", (ui.size.height - 299) + "px");
|
||||
};
|
||||
}
|
||||
|
||||
$("#dialog").on("dialogresize", switchDialogResize);
|
||||
$("#dialog").one("dialogopen", function (ev) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
module.exports = function(RED) {
|
||||
"use strict";
|
||||
var util = require("util");
|
||||
var exec = require('child_process').exec;
|
||||
//var exec = require('child_process').exec;
|
||||
var spawn = require('child_process').spawn;
|
||||
var fs = require('fs');
|
||||
|
||||
@ -105,7 +105,7 @@ module.exports = function(RED) {
|
||||
if (RED.settings.verbose) { node.log("err: "+data+" :"); }
|
||||
});
|
||||
|
||||
node.child.on('close', function (code) {
|
||||
node.child.on('close', function () {
|
||||
node.child = null;
|
||||
node.running = false;
|
||||
node.status({fill:"red",shape:"circle",text:""});
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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.",
|
||||
"dependencies" : {
|
||||
},
|
||||
|
@ -17,7 +17,6 @@
|
||||
module.exports = function(RED) {
|
||||
"use strict";
|
||||
var util = require("util");
|
||||
var exec = require('child_process').exec;
|
||||
var spawn = require('child_process').spawn;
|
||||
var fs = require('fs');
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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.",
|
||||
"dependencies" : {
|
||||
},
|
||||
|
@ -17,7 +17,6 @@
|
||||
module.exports = function(RED) {
|
||||
"use strict";
|
||||
var util = require("util");
|
||||
var exec = require('child_process').exec;
|
||||
var spawn = require('child_process').spawn;
|
||||
var fs = require('fs');
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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",
|
||||
"dependencies" : {
|
||||
},
|
||||
|
@ -129,7 +129,7 @@ module.exports = function(RED) {
|
||||
|
||||
if (typeof(err.name) === 'undefined' || err.name !== 'ReferenceError') {
|
||||
//USB error occurred when BlinkStick was animating
|
||||
node.led.close(function (err) {
|
||||
node.led.close(function () {
|
||||
node.led = undefined;
|
||||
findBlinkStick();
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red-node-blinkstick",
|
||||
"version" : "0.1.5",
|
||||
"version" : "0.1.6",
|
||||
"description" : "A Node-RED node to control a Blinkstick",
|
||||
"dependencies" : {
|
||||
"blinkstick" : "1.1.*"
|
||||
|
@ -145,7 +145,7 @@
|
||||
password: {type: "password"}
|
||||
},
|
||||
label: function() {
|
||||
if (this.service == "") {
|
||||
if (this.service === "") {
|
||||
this.service = "localhost";
|
||||
}
|
||||
return (this.clientid ? this.clientid + "@" : "") + this.service;
|
||||
|
@ -38,9 +38,9 @@ module.exports = function(RED) {
|
||||
ex.stdout.on('data', function (data) {
|
||||
line += data.toString();
|
||||
});
|
||||
ex.stderr.on('data', function (data) {
|
||||
//ex.stderr.on('data', function (data) {
|
||||
//console.log('[ping] stderr: ' + data);
|
||||
});
|
||||
//});
|
||||
ex.on('close', function (code) {
|
||||
var m = regex.exec(line)||"";
|
||||
if (m !== '') {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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.",
|
||||
"dependencies" : {
|
||||
},
|
||||
|
@ -138,7 +138,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
getName(this.credentials.deviceid);
|
||||
}
|
||||
catch(err) {
|
||||
@ -164,8 +164,8 @@
|
||||
function updateDeviceList() {
|
||||
if(!ddConfig.val()) {
|
||||
ddDevice.children().remove();
|
||||
ddDevice.append('<option value="">All</option>')
|
||||
ddDevice.append('<option value="_msg_">- set from msg.deviceid -</option>')
|
||||
ddDevice.append('<option value="">All</option>');
|
||||
ddDevice.append('<option value="_msg_">- set from msg.deviceid -</option>');
|
||||
var currentDevice;
|
||||
if(node.credentials) {
|
||||
currentDevice = node.credentials.deviceid;
|
||||
@ -176,15 +176,15 @@
|
||||
}
|
||||
}
|
||||
else {
|
||||
var config = RED.nodes.node(ddConfig.val()),
|
||||
var config = RED.nodes.node(ddConfig.val()),
|
||||
url = 'pushbullet/'+ddConfig.val()+'/devices';
|
||||
if(config && config.credentials && config.credentials.apikey) {
|
||||
url += '?apikey='+config.credentials.apikey;
|
||||
}
|
||||
$.getJSON(url, function(data) {
|
||||
ddDevice.children().remove();
|
||||
ddDevice.append('<option value="">All</option>')
|
||||
ddDevice.append('<option value="_msg_">- set from msg.deviceid -</option>')
|
||||
ddDevice.append('<option value="">All</option>');
|
||||
ddDevice.append('<option value="_msg_">- set from msg.deviceid -</option>');
|
||||
var currentDevice, addCurrent = true;
|
||||
if(node.credentials) {
|
||||
currentDevice = node.credentials.deviceid;
|
||||
@ -203,7 +203,7 @@
|
||||
}
|
||||
ddDevice.val(currentDevice);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -292,7 +292,7 @@
|
||||
</div>
|
||||
</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><code>msg.pushtype</code>: type of message</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');
|
||||
|
||||
function updateDeviceList() {
|
||||
var config = RED.nodes.node(ddConfig.val()),
|
||||
var config = RED.nodes.node(ddConfig.val()),
|
||||
url = 'pushbullet/'+ddConfig.val()+'/devices';
|
||||
if(config && config.credentials && config.credentials.apikey) {
|
||||
url += '?apikey='+config.credentials.apikey;
|
||||
@ -343,7 +343,7 @@
|
||||
for(var i=0; i<data.length; i++) {
|
||||
var dev = data[i];
|
||||
ddDevice.append('<option value="'+dev.iden+'">'+dev.nickname+' ('+dev.kind+')</option>');
|
||||
|
||||
|
||||
idx = addDevices.indexOf(dev.iden);
|
||||
if (idx > -1) {
|
||||
addDevices.splice(idx, 1);
|
||||
@ -354,7 +354,7 @@
|
||||
ddDevice.append('<option value="'+addDevices[j]+'">'+addDevices[j]+'</option>');
|
||||
}
|
||||
ddDevice.val(currentDevices);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
ddConfig.change(function() {
|
||||
|
@ -153,8 +153,8 @@
|
||||
$("#node-input-credentials-row").hide();
|
||||
}
|
||||
|
||||
if (this.twilioType == null) {
|
||||
if (this.url == "") {
|
||||
if (this.twilioType === null) {
|
||||
if (this.url === "") {
|
||||
this.twilioType = "call";
|
||||
} else {
|
||||
this.twilioType = "sms";
|
||||
|
@ -18,9 +18,6 @@ module.exports = function(RED) {
|
||||
"use strict";
|
||||
var XMPP = require('simple-xmpp');
|
||||
|
||||
try { var xmppkey = RED.settings.xmpp || require(process.env.NODE_RED_HOME+"/../xmppkeys.js"); }
|
||||
catch(err) { }
|
||||
|
||||
function XMPPServerNode(n) {
|
||||
RED.nodes.createNode(this,n);
|
||||
this.server = n.server;
|
||||
@ -73,7 +70,7 @@ function XmppInNode(n) {
|
||||
});
|
||||
|
||||
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]); }
|
||||
});
|
||||
|
||||
@ -93,7 +90,7 @@ function XmppInNode(n) {
|
||||
console.error("error",err);
|
||||
});
|
||||
|
||||
xmpp.on('close', function(err) {
|
||||
xmpp.on('close', function() {
|
||||
node.log('connection closed');
|
||||
node.status({fill:"red",shape:"ring",text:"not connected"});
|
||||
});
|
||||
@ -157,7 +154,7 @@ function XmppOutNode(n) {
|
||||
console.error("error",err);
|
||||
});
|
||||
|
||||
xmpp.on('close', function(err) {
|
||||
xmpp.on('close', function() {
|
||||
node.log('connection closed');
|
||||
node.status({fill:"red",shape:"ring",text:"not connected"});
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red-node-xmpp",
|
||||
"version" : "0.0.4",
|
||||
"version" : "0.0.5",
|
||||
"description" : "A Node-RED node to talk to an XMPP server",
|
||||
"dependencies" : {
|
||||
"simple-xmpp" : "0.1.92"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red-node-sqlite",
|
||||
"version" : "0.0.5",
|
||||
"version" : "0.0.6",
|
||||
"description" : "A sqlite node for Node-RED",
|
||||
"dependencies" : {
|
||||
"sqlite3" : "3.0.*"
|
||||
|
@ -27,13 +27,12 @@ module.exports = function(RED) {
|
||||
|
||||
node.doConnect = function() {
|
||||
node.db = new sqlite3.Database(node.dbname);
|
||||
node.db.on('open',function(err) {
|
||||
if (node.tick) { clearTimeout(node.tick); }
|
||||
node.log("opened "+node.dbname+" ok");
|
||||
node.db.on('open', function() {
|
||||
if (node.tick) { clearTimeout(node.tick); }
|
||||
node.log("opened "+node.dbname+" ok");
|
||||
});
|
||||
node.db.on('error', function(err) {
|
||||
node.error(err);
|
||||
node.log("failed to open "+node.dbname);
|
||||
node.error("failed to open "+node.dbname, err);
|
||||
node.tick = setTimeout(function() { node.doConnect(); }, reconnect);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user