1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00

load of tiny listing fixes, undef, unused, etc

This commit is contained in:
Dave Conway-Jones 2016-04-09 18:00:14 +01:00
parent 37ba29484a
commit 48bcd3c7df
22 changed files with 532 additions and 535 deletions

View File

@ -7,10 +7,10 @@
"disallowMultipleSpaces": {"allowEOLComments": true},
"disallowKeywordsOnNewLine": [],
"requireSpaceBeforeBlockStatements": 1,
"requireSpaceBeforeObjectValues": false,
//"requireSpaceBeforeObjectValues": false,
//"requireSemicolons": true,
//"validateParameterSeparator": ", ",
//"validateQuoteMarks": false,
"requireSpaceAfterKeywords": ["do","for","if","else","switch","case","try","while"],
"maximumLineLength": 255,
"validateQuoteMarks": false
"maximumLineLength": 255
}

View File

@ -1,4 +1,8 @@
{
"predef": [ "RED" ],
"node": true,
"browser": true,
"jquery": true,
"asi": true, // allow missing semicolons
"curly": true, // require braces
"eqnull": true, // ignore ==null
@ -9,5 +13,6 @@
//"unused": true, // Check for unused functions and variables
"loopfunc": true, // allow functions to be defined in loops
//"expr": true, // allow ternery operator syntax...
"sub": true // don't warn that foo['bar'] should be written as foo.bar
"sub": true, // don't warn that foo['bar'] should be written as foo.bar
"undef": true // warn about undefined variables
}

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-pilcd",
"version" : "0.0.4",
"version" : "0.0.5",
"description" : "A Node-RED node for Raspberry Pi to write to HD44780 style LCD panels.",
"dependencies" : {
},

View File

@ -43,7 +43,6 @@ module.exports = function(RED) {
var node = this;
function inputlistener(msg) {
var out = msg.payload.toString();
if (RED.settings.verbose) { node.log("inp: " + msg.payload); }
if (node.child !== null) { node.child.stdin.write(msg.payload + "\n"); }
else { node.warn("Command not running"); }
@ -90,7 +89,6 @@ module.exports = function(RED) {
}
node.on("close", function(done) {
delete pinsInUse[node.pin];
if (node.child != null) {
node.child.stdin.write("c:lose" + node.pin);
node.child.kill('SIGKILL');

View File

@ -27,8 +27,7 @@ module.exports = function(RED) {
var devices = HID.devices(0x16c0,0x05df);
for (var i=0; i< devices.length; i++) {
if (devices[i].product == 'DigiUSB') {
path = devices[i].path;
node.log("found: " + path);
node.log("found: " + devices[i].path);
try {
device = new HID.HID(devices[i].path);
break;

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-digirgb",
"version" : "0.0.5",
"version" : "0.0.6",
"description" : "A Node-RED node to control a Digispark RGB LED",
"dependencies" : {
"node-hid" : "0.4.*"

View File

@ -15,159 +15,160 @@
**/
var colours = {
'aqua':'#00FFFF',
'aliceblue':'#F0F8FF',
'antiquewhite':'#FAEBD7',
'black':'#000000',
'off':'#000000',
'blue':'#0000FF',
'cyan':'#00FFFF',
'darkblue':'#00008B',
'darkcyan':'#008B8B',
'darkgreen':'#006400',
'darkturquoise':'#00CED1',
'deepskyblue':'#00BFFF',
'green':'#008000',
'lime':'#00FF00',
'mediumblue':'#0000CD',
'mediumspringgreen':'#00FA9A',
'navy':'#000080',
'springgreen':'#00FF7F',
'teal':'#008080',
'midnightblue':'#191970',
'dodgerblue':'#1E90FF',
'lightseagreen':'#20B2AA',
'forestgreen':'#228B22',
'seagreen':'#2E8B57',
'darkslategray':'#2F4F4F',
'darkslategrey':'#2F4F4F',
'limegreen':'#32CD32',
'mediumseagreen':'#3CB371',
'turquoise':'#40E0D0',
'royalblue':'#4169E1',
'steelblue':'#4682B4',
'darkslateblue':'#483D8B',
'mediumturquoise':'#48D1CC',
'indigo':'#4B0082',
'darkolivegreen':'#556B2F',
'cadetblue':'#5F9EA0',
'cornflowerblue':'#6495ED',
'mediumaquamarine':'#66CDAA',
'dimgray':'#696969',
'dimgrey':'#696969',
'slateblue':'#6A5ACD',
'olivedrab':'#6B8E23',
'slategray':'#708090',
'slategrey':'#708090',
'lightslategray':'#778899',
'lightslategrey':'#778899',
'mediumslateblue':'#7B68EE',
'lawngreen':'#7CFC00',
'aquamarine':'#7FFFD4',
'chartreuse':'#7FFF00',
'gray':'#808080',
'grey':'#808080',
'maroon':'#800000',
'olive':'#808000',
'purple':'#800080',
'lightskyblue':'#87CEFA',
'skyblue':'#87CEEB',
'blueviolet':'#8A2BE2',
'darkmagenta':'#8B008B',
'darkred':'#8B0000',
'saddlebrown':'#8B4513',
'darkseagreen':'#8FBC8F',
'lightgreen':'#90EE90',
'mediumpurple':'#9370DB',
'darkviolet':'#9400D3',
'palegreen':'#98FB98',
'darkorchid':'#9932CC',
'yellowgreen':'#9ACD32',
'sienna':'#A0522D',
'brown':'#A52A2A',
'darkgray':'#A9A9A9',
'darkgrey':'#A9A9A9',
'greenyellow':'#ADFF2F',
'lightblue':'#ADD8E6',
'paleturquoise':'#AFEEEE',
'lightsteelblue':'#B0C4DE',
'powderblue':'#B0E0E6',
'firebrick':'#B22222',
'darkgoldenrod':'#B8860B',
'mediumorchid':'#BA55D3',
'rosybrown':'#BC8F8F',
'darkkhaki':'#BDB76B',
'silver':'#C0C0C0',
'mediumvioletred':'#C71585',
'indianred':'#CD5C5C',
'peru':'#CD853F',
'chocolate':'#D2691E',
'tan':'#D2B48C',
'lightgray':'#D3D3D3',
'lightgrey':'#D3D3D3',
'thistle':'#D8BFD8',
'goldenrod':'#DAA520',
'orchid':'#DA70D6',
'palevioletred':'#DB7093',
'crimson':'#DC143C',
'gainsboro':'#DCDCDC',
'plum':'#DDA0DD',
'burlywood':'#DEB887',
'lightcyan':'#E0FFFF',
'lavender':'#E6E6FA',
'darksalmon':'#E9967A',
'palegoldenrod':'#EEE8AA',
'violet':'#EE82EE',
'azure':'#F0FFFF',
'honeydew':'#F0FFF0',
'khaki':'#F0E68C',
'lightcoral':'#F08080',
'sandybrown':'#F4A460',
'beige':'#F5F5DC',
'mintcream':'#F5FFFA',
'wheat':'#F5DEB3',
'whitesmoke':'#F5F5F5',
'ghostwhite':'#F8F8FF',
'lightgoldenrodyellow':'#FAFAD2',
'linen':'#FAF0E6',
'salmon':'#FA8072',
'oldlace':'#FDF5E6',
'warmwhite':'#FDF5E6',
'bisque':'#FFE4C4',
'blanchedalmond':'#FFEBCD',
'coral':'#FF7F50',
'cornsilk':'#FFF8DC',
'darkorange':'#FF8C00',
'deeppink':'#FF1493',
'floralwhite':'#FFFAF0',
'fuchsia':'#FF00FF',
'gold':'#FFD700',
'hotpink':'#FF69B4',
'ivory':'#FFFFF0',
'lavenderblush':'#FFF0F5',
'lemonchiffon':'#FFFACD',
'lightpink':'#FFB6C1',
'lightsalmon':'#FFA07A',
'lightyellow':'#FFFFE0',
'magenta':'#FF00FF',
'mistyrose':'#FFE4E1',
'moccasin':'#FFE4B5',
'navajowhite':'#FFDEAD',
'orange':'#FFA500',
'orangered':'#FF4500',
'papayawhip':'#FFEFD5',
'peachpuff':'#FFDAB9',
'pink':'#FFC0CB',
'red':'#FF0000',
'seashell':'#FFF5EE',
'snow':'#FFFAFA',
'tomato':'#FF6347',
'white':'#FFFFFF',
'yellow':'#FFFF00',
'amber':'#FFD200'
'aqua':'#00FFFF',
'aliceblue':'#F0F8FF',
'antiquewhite':'#FAEBD7',
'black':'#000000',
'off':'#000000',
'blue':'#0000FF',
'cyan':'#00FFFF',
'darkblue':'#00008B',
'darkcyan':'#008B8B',
'darkgreen':'#006400',
'darkturquoise':'#00CED1',
'deepskyblue':'#00BFFF',
'green':'#008000',
'lime':'#00FF00',
'mediumblue':'#0000CD',
'mediumspringgreen':'#00FA9A',
'navy':'#000080',
'springgreen':'#00FF7F',
'teal':'#008080',
'midnightblue':'#191970',
'dodgerblue':'#1E90FF',
'lightseagreen':'#20B2AA',
'forestgreen':'#228B22',
'seagreen':'#2E8B57',
'darkslategray':'#2F4F4F',
'darkslategrey':'#2F4F4F',
'limegreen':'#32CD32',
'mediumseagreen':'#3CB371',
'turquoise':'#40E0D0',
'royalblue':'#4169E1',
'steelblue':'#4682B4',
'darkslateblue':'#483D8B',
'mediumturquoise':'#48D1CC',
'indigo':'#4B0082',
'darkolivegreen':'#556B2F',
'cadetblue':'#5F9EA0',
'cornflowerblue':'#6495ED',
'mediumaquamarine':'#66CDAA',
'dimgray':'#696969',
'dimgrey':'#696969',
'slateblue':'#6A5ACD',
'olivedrab':'#6B8E23',
'slategray':'#708090',
'slategrey':'#708090',
'lightslategray':'#778899',
'lightslategrey':'#778899',
'mediumslateblue':'#7B68EE',
'lawngreen':'#7CFC00',
'aquamarine':'#7FFFD4',
'chartreuse':'#7FFF00',
'gray':'#808080',
'grey':'#808080',
'maroon':'#800000',
'olive':'#808000',
'purple':'#800080',
'lightskyblue':'#87CEFA',
'skyblue':'#87CEEB',
'blueviolet':'#8A2BE2',
'darkmagenta':'#8B008B',
'darkred':'#8B0000',
'saddlebrown':'#8B4513',
'darkseagreen':'#8FBC8F',
'lightgreen':'#90EE90',
'mediumpurple':'#9370DB',
'darkviolet':'#9400D3',
'palegreen':'#98FB98',
'darkorchid':'#9932CC',
'yellowgreen':'#9ACD32',
'sienna':'#A0522D',
'brown':'#A52A2A',
'darkgray':'#A9A9A9',
'darkgrey':'#A9A9A9',
'greenyellow':'#ADFF2F',
'lightblue':'#ADD8E6',
'paleturquoise':'#AFEEEE',
'lightsteelblue':'#B0C4DE',
'powderblue':'#B0E0E6',
'firebrick':'#B22222',
'darkgoldenrod':'#B8860B',
'mediumorchid':'#BA55D3',
'rosybrown':'#BC8F8F',
'darkkhaki':'#BDB76B',
'silver':'#C0C0C0',
'mediumvioletred':'#C71585',
'indianred':'#CD5C5C',
'peru':'#CD853F',
'chocolate':'#D2691E',
'tan':'#D2B48C',
'lightgray':'#D3D3D3',
'lightgrey':'#D3D3D3',
'thistle':'#D8BFD8',
'goldenrod':'#DAA520',
'orchid':'#DA70D6',
'palevioletred':'#DB7093',
'crimson':'#DC143C',
'gainsboro':'#DCDCDC',
'plum':'#DDA0DD',
'burlywood':'#DEB887',
'lightcyan':'#E0FFFF',
'lavender':'#E6E6FA',
'darksalmon':'#E9967A',
'palegoldenrod':'#EEE8AA',
'violet':'#EE82EE',
'azure':'#F0FFFF',
'honeydew':'#F0FFF0',
'khaki':'#F0E68C',
'lightcoral':'#F08080',
'sandybrown':'#F4A460',
'beige':'#F5F5DC',
'mintcream':'#F5FFFA',
'wheat':'#F5DEB3',
'whitesmoke':'#F5F5F5',
'ghostwhite':'#F8F8FF',
'lightgoldenrodyellow':'#FAFAD2',
'linen':'#FAF0E6',
'salmon':'#FA8072',
'oldlace':'#FDF5E6',
'warmwhite':'#FDF5E6',
'bisque':'#FFE4C4',
'blanchedalmond':'#FFEBCD',
'coral':'#FF7F50',
'cornsilk':'#FFF8DC',
'darkorange':'#FF8C00',
'deeppink':'#FF1493',
'floralwhite':'#FFFAF0',
'fuchsia':'#FF00FF',
'gold':'#FFD700',
'hotpink':'#FF69B4',
'ivory':'#FFFFF0',
'lavenderblush':'#FFF0F5',
'lemonchiffon':'#FFFACD',
'lightpink':'#FFB6C1',
'lightsalmon':'#FFA07A',
'lightyellow':'#FFFFE0',
'magenta':'#FF00FF',
'mistyrose':'#FFE4E1',
'moccasin':'#FFE4B5',
'navajowhite':'#FFDEAD',
'orange':'#FFA500',
'orangered':'#FF4500',
'papayawhip':'#FFEFD5',
'peachpuff':'#FFDAB9',
'pink':'#FFC0CB',
'red':'#FF0000',
'seashell':'#FFF5EE',
'snow':'#FFFAFA',
'tomato':'#FF6347',
'white':'#FFFFFF',
'yellow':'#FFFF00',
'amber':'#FFD200'
};
var p1 = /^\#[A-Fa-f0-9]{6}$/
var p1 = /^\#[A-Fa-f0-9]{6}$/;
var r, g, b;
module.exports.getRGB = function(col,rgb) {
col = col.toString().toLowerCase();

View File

@ -51,7 +51,7 @@ module.exports = function(RED) {
if (this.wipe < 0) { this.wipe = 0; }
var node = this;
var needle = "255,255,255";
var p1 = /^\#[A-Fa-f0-9]{6}$/
//var p1 = /^\#[A-Fa-f0-9]{6}$/
var p2 = /^[0-9]+,[0-9]+,[0-9]+$/
var p3 = /^[0-9]+,[0-9]+,[0-9]+,[0-9]+$/
var p4 = /^[0-9]+,[0-9]+,[0-9]+,[0-9]+,[0-9]+$/
@ -125,7 +125,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;
if (RED.settings.verbose) { node.log(RED._("rpi-gpio.status.closed")); }
if (node.done) {

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-pi-neopixel",
"version" : "0.0.11",
"version" : "0.0.12",
"description" : "A Node-RED node to output to a neopixel (ws2812) string of LEDS from a Raspberry Pi.",
"dependencies" : {
},

View File

@ -18,56 +18,56 @@
* limitations under the License.
**/
//might need to modify accordingly
var RED = require(process.env.NODE_RED_HOME+"/red/red");
module.exports = function(RED) {
"use strict";
//import noble
var noble = require('noble');
//import noble
var noble = require('noble');
// The main node definition - most things happen in here
function BleScan(n) {
// Create a RED node
RED.nodes.createNode(this,n);
// The main node definition - most things happen in here
function BleScan(n) {
// Create a RED node
RED.nodes.createNode(this,n);
var msg = {};
var ble_name;
var node = this;
//get name and uuid from user
this.ble_name = n.ble_name;
this.ble_uuid = n.ble_uuid;
this.on("input", function(msg) {
noble.startScanning();
});
noble.on('scanStart', function(msg) {
msg = {};
msg.topic = node.topic;
msg.payload = "Scanning initiated..." //debugging
//console.log('scanning initiated...');
node.send(msg);
});
noble.on('discover', function(peripheral) {
var msg = {};
msg.topic = node.topic;
msg.payload = "not found";
var ble_name;
var node = this;
//check for the device name and the UUID (first one from the UUID list)
if (peripheral.advertisement.localName==node.ble_name && peripheral.advertisement.serviceUuids[0]==node.ble_uuid) {
msg.payload=peripheral.advertisement.localName;
noble.stopScanning();
}
node.send(msg);
});
//get name and uuid from user
this.ble_name = n.ble_name;
this.ble_uuid = n.ble_uuid;
this.on("close", function() {
try { noble.stopScanning(); }
catch (err) { console.log(err); }
});
this.on("input", function(msg) {
noble.startScanning();
});
noble.on('scanStart', function(msg) {
msg = {};
msg.topic = node.topic;
msg.payload = "Scanning initiated..." //debugging
//console.log('scanning initiated...');
node.send(msg);
});
noble.on('discover', function(peripheral) {
var msg = {};
msg.topic = node.topic;
msg.payload = "not found";
//check for the device name and the UUID (first one from the UUID list)
if (peripheral.advertisement.localName==node.ble_name && peripheral.advertisement.serviceUuids[0]==node.ble_uuid) {
msg.payload=peripheral.advertisement.localName;
noble.stopScanning();
}
node.send(msg);
});
this.on("close", function() {
try { noble.stopScanning(); }
catch (err) { console.log(err); }
});
}
// Register the node by name. This must be called before overriding any of the
// Node functions.
RED.nodes.registerType("scanBLE", BleScan);
}
// Register the node by name. This must be called before overriding any of the
// Node functions.
RED.nodes.registerType("scanBLE", BleScan);

View File

@ -15,159 +15,160 @@
**/
var colours = {
'aqua':'#00FFFF',
'aliceblue':'#F0F8FF',
'antiquewhite':'#FAEBD7',
'black':'#000000',
'off':'#000000',
'blue':'#0000FF',
'cyan':'#00FFFF',
'darkblue':'#00008B',
'darkcyan':'#008B8B',
'darkgreen':'#006400',
'darkturquoise':'#00CED1',
'deepskyblue':'#00BFFF',
'green':'#008000',
'lime':'#00FF00',
'mediumblue':'#0000CD',
'mediumspringgreen':'#00FA9A',
'navy':'#000080',
'springgreen':'#00FF7F',
'teal':'#008080',
'midnightblue':'#191970',
'dodgerblue':'#1E90FF',
'lightseagreen':'#20B2AA',
'forestgreen':'#228B22',
'seagreen':'#2E8B57',
'darkslategray':'#2F4F4F',
'darkslategrey':'#2F4F4F',
'limegreen':'#32CD32',
'mediumseagreen':'#3CB371',
'turquoise':'#40E0D0',
'royalblue':'#4169E1',
'steelblue':'#4682B4',
'darkslateblue':'#483D8B',
'mediumturquoise':'#48D1CC',
'indigo':'#4B0082',
'darkolivegreen':'#556B2F',
'cadetblue':'#5F9EA0',
'cornflowerblue':'#6495ED',
'mediumaquamarine':'#66CDAA',
'dimgray':'#696969',
'dimgrey':'#696969',
'slateblue':'#6A5ACD',
'olivedrab':'#6B8E23',
'slategray':'#708090',
'slategrey':'#708090',
'lightslategray':'#778899',
'lightslategrey':'#778899',
'mediumslateblue':'#7B68EE',
'lawngreen':'#7CFC00',
'aquamarine':'#7FFFD4',
'chartreuse':'#7FFF00',
'gray':'#808080',
'grey':'#808080',
'maroon':'#800000',
'olive':'#808000',
'purple':'#800080',
'lightskyblue':'#87CEFA',
'skyblue':'#87CEEB',
'blueviolet':'#8A2BE2',
'darkmagenta':'#8B008B',
'darkred':'#8B0000',
'saddlebrown':'#8B4513',
'darkseagreen':'#8FBC8F',
'lightgreen':'#90EE90',
'mediumpurple':'#9370DB',
'darkviolet':'#9400D3',
'palegreen':'#98FB98',
'darkorchid':'#9932CC',
'yellowgreen':'#9ACD32',
'sienna':'#A0522D',
'brown':'#A52A2A',
'darkgray':'#A9A9A9',
'darkgrey':'#A9A9A9',
'greenyellow':'#ADFF2F',
'lightblue':'#ADD8E6',
'paleturquoise':'#AFEEEE',
'lightsteelblue':'#B0C4DE',
'powderblue':'#B0E0E6',
'firebrick':'#B22222',
'darkgoldenrod':'#B8860B',
'mediumorchid':'#BA55D3',
'rosybrown':'#BC8F8F',
'darkkhaki':'#BDB76B',
'silver':'#C0C0C0',
'mediumvioletred':'#C71585',
'indianred':'#CD5C5C',
'peru':'#CD853F',
'chocolate':'#D2691E',
'tan':'#D2B48C',
'lightgray':'#D3D3D3',
'lightgrey':'#D3D3D3',
'thistle':'#D8BFD8',
'goldenrod':'#DAA520',
'orchid':'#DA70D6',
'palevioletred':'#DB7093',
'crimson':'#DC143C',
'gainsboro':'#DCDCDC',
'plum':'#DDA0DD',
'burlywood':'#DEB887',
'lightcyan':'#E0FFFF',
'lavender':'#E6E6FA',
'darksalmon':'#E9967A',
'palegoldenrod':'#EEE8AA',
'violet':'#EE82EE',
'azure':'#F0FFFF',
'honeydew':'#F0FFF0',
'khaki':'#F0E68C',
'lightcoral':'#F08080',
'sandybrown':'#F4A460',
'beige':'#F5F5DC',
'mintcream':'#F5FFFA',
'wheat':'#F5DEB3',
'whitesmoke':'#F5F5F5',
'ghostwhite':'#F8F8FF',
'lightgoldenrodyellow':'#FAFAD2',
'linen':'#FAF0E6',
'salmon':'#FA8072',
'oldlace':'#FDF5E6',
'warmwhite':'#FDF5E6',
'bisque':'#FFE4C4',
'blanchedalmond':'#FFEBCD',
'coral':'#FF7F50',
'cornsilk':'#FFF8DC',
'darkorange':'#FF8C00',
'deeppink':'#FF1493',
'floralwhite':'#FFFAF0',
'fuchsia':'#FF00FF',
'gold':'#FFD700',
'hotpink':'#FF69B4',
'ivory':'#FFFFF0',
'lavenderblush':'#FFF0F5',
'lemonchiffon':'#FFFACD',
'lightpink':'#FFB6C1',
'lightsalmon':'#FFA07A',
'lightyellow':'#FFFFE0',
'magenta':'#FF00FF',
'mistyrose':'#FFE4E1',
'moccasin':'#FFE4B5',
'navajowhite':'#FFDEAD',
'orange':'#FFA500',
'orangered':'#FF4500',
'papayawhip':'#FFEFD5',
'peachpuff':'#FFDAB9',
'pink':'#FFC0CB',
'red':'#FF0000',
'seashell':'#FFF5EE',
'snow':'#FFFAFA',
'tomato':'#FF6347',
'white':'#FFFFFF',
'yellow':'#FFFF00',
'amber':'#FFD200'
'aqua':'#00FFFF',
'aliceblue':'#F0F8FF',
'antiquewhite':'#FAEBD7',
'black':'#000000',
'off':'#000000',
'blue':'#0000FF',
'cyan':'#00FFFF',
'darkblue':'#00008B',
'darkcyan':'#008B8B',
'darkgreen':'#006400',
'darkturquoise':'#00CED1',
'deepskyblue':'#00BFFF',
'green':'#008000',
'lime':'#00FF00',
'mediumblue':'#0000CD',
'mediumspringgreen':'#00FA9A',
'navy':'#000080',
'springgreen':'#00FF7F',
'teal':'#008080',
'midnightblue':'#191970',
'dodgerblue':'#1E90FF',
'lightseagreen':'#20B2AA',
'forestgreen':'#228B22',
'seagreen':'#2E8B57',
'darkslategray':'#2F4F4F',
'darkslategrey':'#2F4F4F',
'limegreen':'#32CD32',
'mediumseagreen':'#3CB371',
'turquoise':'#40E0D0',
'royalblue':'#4169E1',
'steelblue':'#4682B4',
'darkslateblue':'#483D8B',
'mediumturquoise':'#48D1CC',
'indigo':'#4B0082',
'darkolivegreen':'#556B2F',
'cadetblue':'#5F9EA0',
'cornflowerblue':'#6495ED',
'mediumaquamarine':'#66CDAA',
'dimgray':'#696969',
'dimgrey':'#696969',
'slateblue':'#6A5ACD',
'olivedrab':'#6B8E23',
'slategray':'#708090',
'slategrey':'#708090',
'lightslategray':'#778899',
'lightslategrey':'#778899',
'mediumslateblue':'#7B68EE',
'lawngreen':'#7CFC00',
'aquamarine':'#7FFFD4',
'chartreuse':'#7FFF00',
'gray':'#808080',
'grey':'#808080',
'maroon':'#800000',
'olive':'#808000',
'purple':'#800080',
'lightskyblue':'#87CEFA',
'skyblue':'#87CEEB',
'blueviolet':'#8A2BE2',
'darkmagenta':'#8B008B',
'darkred':'#8B0000',
'saddlebrown':'#8B4513',
'darkseagreen':'#8FBC8F',
'lightgreen':'#90EE90',
'mediumpurple':'#9370DB',
'darkviolet':'#9400D3',
'palegreen':'#98FB98',
'darkorchid':'#9932CC',
'yellowgreen':'#9ACD32',
'sienna':'#A0522D',
'brown':'#A52A2A',
'darkgray':'#A9A9A9',
'darkgrey':'#A9A9A9',
'greenyellow':'#ADFF2F',
'lightblue':'#ADD8E6',
'paleturquoise':'#AFEEEE',
'lightsteelblue':'#B0C4DE',
'powderblue':'#B0E0E6',
'firebrick':'#B22222',
'darkgoldenrod':'#B8860B',
'mediumorchid':'#BA55D3',
'rosybrown':'#BC8F8F',
'darkkhaki':'#BDB76B',
'silver':'#C0C0C0',
'mediumvioletred':'#C71585',
'indianred':'#CD5C5C',
'peru':'#CD853F',
'chocolate':'#D2691E',
'tan':'#D2B48C',
'lightgray':'#D3D3D3',
'lightgrey':'#D3D3D3',
'thistle':'#D8BFD8',
'goldenrod':'#DAA520',
'orchid':'#DA70D6',
'palevioletred':'#DB7093',
'crimson':'#DC143C',
'gainsboro':'#DCDCDC',
'plum':'#DDA0DD',
'burlywood':'#DEB887',
'lightcyan':'#E0FFFF',
'lavender':'#E6E6FA',
'darksalmon':'#E9967A',
'palegoldenrod':'#EEE8AA',
'violet':'#EE82EE',
'azure':'#F0FFFF',
'honeydew':'#F0FFF0',
'khaki':'#F0E68C',
'lightcoral':'#F08080',
'sandybrown':'#F4A460',
'beige':'#F5F5DC',
'mintcream':'#F5FFFA',
'wheat':'#F5DEB3',
'whitesmoke':'#F5F5F5',
'ghostwhite':'#F8F8FF',
'lightgoldenrodyellow':'#FAFAD2',
'linen':'#FAF0E6',
'salmon':'#FA8072',
'oldlace':'#FDF5E6',
'warmwhite':'#FDF5E6',
'bisque':'#FFE4C4',
'blanchedalmond':'#FFEBCD',
'coral':'#FF7F50',
'cornsilk':'#FFF8DC',
'darkorange':'#FF8C00',
'deeppink':'#FF1493',
'floralwhite':'#FFFAF0',
'fuchsia':'#FF00FF',
'gold':'#FFD700',
'hotpink':'#FF69B4',
'ivory':'#FFFFF0',
'lavenderblush':'#FFF0F5',
'lemonchiffon':'#FFFACD',
'lightpink':'#FFB6C1',
'lightsalmon':'#FFA07A',
'lightyellow':'#FFFFE0',
'magenta':'#FF00FF',
'mistyrose':'#FFE4E1',
'moccasin':'#FFE4B5',
'navajowhite':'#FFDEAD',
'orange':'#FFA500',
'orangered':'#FF4500',
'papayawhip':'#FFEFD5',
'peachpuff':'#FFDAB9',
'pink':'#FFC0CB',
'red':'#FF0000',
'seashell':'#FFF5EE',
'snow':'#FFFAFA',
'tomato':'#FF6347',
'white':'#FFFFFF',
'yellow':'#FFFF00',
'amber':'#FFD200'
};
var hexColour = /^#([0-9A-F][0-9A-F][0-9A-F]){1,2}$/i;
var r, g, b;
module.exports.getRGB = function(col,rgb) {
if (!col) {

View File

@ -15,159 +15,160 @@
**/
var colours = {
'aqua':'#00FFFF',
'aliceblue':'#F0F8FF',
'antiquewhite':'#FAEBD7',
'black':'#000000',
'off':'#000000',
'blue':'#0000FF',
'cyan':'#00FFFF',
'darkblue':'#00008B',
'darkcyan':'#008B8B',
'darkgreen':'#006400',
'darkturquoise':'#00CED1',
'deepskyblue':'#00BFFF',
'green':'#008000',
'lime':'#00FF00',
'mediumblue':'#0000CD',
'mediumspringgreen':'#00FA9A',
'navy':'#000080',
'springgreen':'#00FF7F',
'teal':'#008080',
'midnightblue':'#191970',
'dodgerblue':'#1E90FF',
'lightseagreen':'#20B2AA',
'forestgreen':'#228B22',
'seagreen':'#2E8B57',
'darkslategray':'#2F4F4F',
'darkslategrey':'#2F4F4F',
'limegreen':'#32CD32',
'mediumseagreen':'#3CB371',
'turquoise':'#40E0D0',
'royalblue':'#4169E1',
'steelblue':'#4682B4',
'darkslateblue':'#483D8B',
'mediumturquoise':'#48D1CC',
'indigo':'#4B0082',
'darkolivegreen':'#556B2F',
'cadetblue':'#5F9EA0',
'cornflowerblue':'#6495ED',
'mediumaquamarine':'#66CDAA',
'dimgray':'#696969',
'dimgrey':'#696969',
'slateblue':'#6A5ACD',
'olivedrab':'#6B8E23',
'slategray':'#708090',
'slategrey':'#708090',
'lightslategray':'#778899',
'lightslategrey':'#778899',
'mediumslateblue':'#7B68EE',
'lawngreen':'#7CFC00',
'aquamarine':'#7FFFD4',
'chartreuse':'#7FFF00',
'gray':'#808080',
'grey':'#808080',
'maroon':'#800000',
'olive':'#808000',
'purple':'#800080',
'lightskyblue':'#87CEFA',
'skyblue':'#87CEEB',
'blueviolet':'#8A2BE2',
'darkmagenta':'#8B008B',
'darkred':'#8B0000',
'saddlebrown':'#8B4513',
'darkseagreen':'#8FBC8F',
'lightgreen':'#90EE90',
'mediumpurple':'#9370DB',
'darkviolet':'#9400D3',
'palegreen':'#98FB98',
'darkorchid':'#9932CC',
'yellowgreen':'#9ACD32',
'sienna':'#A0522D',
'brown':'#A52A2A',
'darkgray':'#A9A9A9',
'darkgrey':'#A9A9A9',
'greenyellow':'#ADFF2F',
'lightblue':'#ADD8E6',
'paleturquoise':'#AFEEEE',
'lightsteelblue':'#B0C4DE',
'powderblue':'#B0E0E6',
'firebrick':'#B22222',
'darkgoldenrod':'#B8860B',
'mediumorchid':'#BA55D3',
'rosybrown':'#BC8F8F',
'darkkhaki':'#BDB76B',
'silver':'#C0C0C0',
'mediumvioletred':'#C71585',
'indianred':'#CD5C5C',
'peru':'#CD853F',
'chocolate':'#D2691E',
'tan':'#D2B48C',
'lightgray':'#D3D3D3',
'lightgrey':'#D3D3D3',
'thistle':'#D8BFD8',
'goldenrod':'#DAA520',
'orchid':'#DA70D6',
'palevioletred':'#DB7093',
'crimson':'#DC143C',
'gainsboro':'#DCDCDC',
'plum':'#DDA0DD',
'burlywood':'#DEB887',
'lightcyan':'#E0FFFF',
'lavender':'#E6E6FA',
'darksalmon':'#E9967A',
'palegoldenrod':'#EEE8AA',
'violet':'#EE82EE',
'azure':'#F0FFFF',
'honeydew':'#F0FFF0',
'khaki':'#F0E68C',
'lightcoral':'#F08080',
'sandybrown':'#F4A460',
'beige':'#F5F5DC',
'mintcream':'#F5FFFA',
'wheat':'#F5DEB3',
'whitesmoke':'#F5F5F5',
'ghostwhite':'#F8F8FF',
'lightgoldenrodyellow':'#FAFAD2',
'linen':'#FAF0E6',
'salmon':'#FA8072',
'oldlace':'#FDF5E6',
'warmwhite':'#FDF5E6',
'bisque':'#FFE4C4',
'blanchedalmond':'#FFEBCD',
'coral':'#FF7F50',
'cornsilk':'#FFF8DC',
'darkorange':'#FF8C00',
'deeppink':'#FF1493',
'floralwhite':'#FFFAF0',
'fuchsia':'#FF00FF',
'gold':'#FFD700',
'hotpink':'#FF69B4',
'ivory':'#FFFFF0',
'lavenderblush':'#FFF0F5',
'lemonchiffon':'#FFFACD',
'lightpink':'#FFB6C1',
'lightsalmon':'#FFA07A',
'lightyellow':'#FFFFE0',
'magenta':'#FF00FF',
'mistyrose':'#FFE4E1',
'moccasin':'#FFE4B5',
'navajowhite':'#FFDEAD',
'orange':'#FFA500',
'orangered':'#FF4500',
'papayawhip':'#FFEFD5',
'peachpuff':'#FFDAB9',
'pink':'#FFC0CB',
'red':'#FF0000',
'seashell':'#FFF5EE',
'snow':'#FFFAFA',
'tomato':'#FF6347',
'white':'#FFFFFF',
'yellow':'#FFFF00',
'amber':'#FFD200'
'aqua':'#00FFFF',
'aliceblue':'#F0F8FF',
'antiquewhite':'#FAEBD7',
'black':'#000000',
'off':'#000000',
'blue':'#0000FF',
'cyan':'#00FFFF',
'darkblue':'#00008B',
'darkcyan':'#008B8B',
'darkgreen':'#006400',
'darkturquoise':'#00CED1',
'deepskyblue':'#00BFFF',
'green':'#008000',
'lime':'#00FF00',
'mediumblue':'#0000CD',
'mediumspringgreen':'#00FA9A',
'navy':'#000080',
'springgreen':'#00FF7F',
'teal':'#008080',
'midnightblue':'#191970',
'dodgerblue':'#1E90FF',
'lightseagreen':'#20B2AA',
'forestgreen':'#228B22',
'seagreen':'#2E8B57',
'darkslategray':'#2F4F4F',
'darkslategrey':'#2F4F4F',
'limegreen':'#32CD32',
'mediumseagreen':'#3CB371',
'turquoise':'#40E0D0',
'royalblue':'#4169E1',
'steelblue':'#4682B4',
'darkslateblue':'#483D8B',
'mediumturquoise':'#48D1CC',
'indigo':'#4B0082',
'darkolivegreen':'#556B2F',
'cadetblue':'#5F9EA0',
'cornflowerblue':'#6495ED',
'mediumaquamarine':'#66CDAA',
'dimgray':'#696969',
'dimgrey':'#696969',
'slateblue':'#6A5ACD',
'olivedrab':'#6B8E23',
'slategray':'#708090',
'slategrey':'#708090',
'lightslategray':'#778899',
'lightslategrey':'#778899',
'mediumslateblue':'#7B68EE',
'lawngreen':'#7CFC00',
'aquamarine':'#7FFFD4',
'chartreuse':'#7FFF00',
'gray':'#808080',
'grey':'#808080',
'maroon':'#800000',
'olive':'#808000',
'purple':'#800080',
'lightskyblue':'#87CEFA',
'skyblue':'#87CEEB',
'blueviolet':'#8A2BE2',
'darkmagenta':'#8B008B',
'darkred':'#8B0000',
'saddlebrown':'#8B4513',
'darkseagreen':'#8FBC8F',
'lightgreen':'#90EE90',
'mediumpurple':'#9370DB',
'darkviolet':'#9400D3',
'palegreen':'#98FB98',
'darkorchid':'#9932CC',
'yellowgreen':'#9ACD32',
'sienna':'#A0522D',
'brown':'#A52A2A',
'darkgray':'#A9A9A9',
'darkgrey':'#A9A9A9',
'greenyellow':'#ADFF2F',
'lightblue':'#ADD8E6',
'paleturquoise':'#AFEEEE',
'lightsteelblue':'#B0C4DE',
'powderblue':'#B0E0E6',
'firebrick':'#B22222',
'darkgoldenrod':'#B8860B',
'mediumorchid':'#BA55D3',
'rosybrown':'#BC8F8F',
'darkkhaki':'#BDB76B',
'silver':'#C0C0C0',
'mediumvioletred':'#C71585',
'indianred':'#CD5C5C',
'peru':'#CD853F',
'chocolate':'#D2691E',
'tan':'#D2B48C',
'lightgray':'#D3D3D3',
'lightgrey':'#D3D3D3',
'thistle':'#D8BFD8',
'goldenrod':'#DAA520',
'orchid':'#DA70D6',
'palevioletred':'#DB7093',
'crimson':'#DC143C',
'gainsboro':'#DCDCDC',
'plum':'#DDA0DD',
'burlywood':'#DEB887',
'lightcyan':'#E0FFFF',
'lavender':'#E6E6FA',
'darksalmon':'#E9967A',
'palegoldenrod':'#EEE8AA',
'violet':'#EE82EE',
'azure':'#F0FFFF',
'honeydew':'#F0FFF0',
'khaki':'#F0E68C',
'lightcoral':'#F08080',
'sandybrown':'#F4A460',
'beige':'#F5F5DC',
'mintcream':'#F5FFFA',
'wheat':'#F5DEB3',
'whitesmoke':'#F5F5F5',
'ghostwhite':'#F8F8FF',
'lightgoldenrodyellow':'#FAFAD2',
'linen':'#FAF0E6',
'salmon':'#FA8072',
'oldlace':'#FDF5E6',
'warmwhite':'#FDF5E6',
'bisque':'#FFE4C4',
'blanchedalmond':'#FFEBCD',
'coral':'#FF7F50',
'cornsilk':'#FFF8DC',
'darkorange':'#FF8C00',
'deeppink':'#FF1493',
'floralwhite':'#FFFAF0',
'fuchsia':'#FF00FF',
'gold':'#FFD700',
'hotpink':'#FF69B4',
'ivory':'#FFFFF0',
'lavenderblush':'#FFF0F5',
'lemonchiffon':'#FFFACD',
'lightpink':'#FFB6C1',
'lightsalmon':'#FFA07A',
'lightyellow':'#FFFFE0',
'magenta':'#FF00FF',
'mistyrose':'#FFE4E1',
'moccasin':'#FFE4B5',
'navajowhite':'#FFDEAD',
'orange':'#FFA500',
'orangered':'#FF4500',
'papayawhip':'#FFEFD5',
'peachpuff':'#FFDAB9',
'pink':'#FFC0CB',
'red':'#FF0000',
'seashell':'#FFF5EE',
'snow':'#FFFAFA',
'tomato':'#FF6347',
'white':'#FFFFFF',
'yellow':'#FFFF00',
'amber':'#FFD200'
};
var hexColour = /^#([0-9A-F][0-9A-F][0-9A-F]){1,2}$/i;
var r, g, b;
module.exports.getRGB = function(col,rgb) {
if (!col) {

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-pi-unicorn-hat",
"version" : "0.0.12",
"version" : "0.0.13",
"description" : "A Node-RED node to output to a Raspberry Pi Unicorn HAT from Pimorini.",
"dependencies" : {
"pngjs": "2.2.*"

View File

@ -93,7 +93,7 @@ module.exports = function(RED) {
function inputlistener(msg) {
if (typeof msg.payload === "string") {
var a,b,c,d,e,i,j,x,y;
var a,b,i,j,x,y;
msg.payload = msg.payload.replace('"','');
var s = msg.payload.toUpperCase().split(",");
var doDraw = true;
@ -235,7 +235,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;
if (RED.settings.verbose) { node.log(RED._("rpi-gpio.status.closed")); }
if (node.done) {
@ -253,7 +253,7 @@ module.exports = function(RED) {
node.on("close", function(done) {
node.status({fill:"grey",shape:"ring",text:"closed"});
if (node.tout) { clearTimeout(tout); }
if (node.tout) { clearTimeout(node.tout); }
if (node.child != null) {
node.done = done;
node.child.kill('SIGKILL');

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-snmp",
"version" : "0.0.5",
"version" : "0.0.6",
"description" : "A Node-RED node that looks for SNMP oids.",
"dependencies" : {
"net-snmp" : "1.1.13"

View File

@ -65,6 +65,7 @@ module.exports = function(RED) {
this.oids = n.oids.replace(/\s/g,"");
this.session = snmp.createSession (this.host, this.community, {version: this.version});
var node = this;
var msg;
var maxRepetitions = 20;
function sortInt (a, b) {
@ -101,7 +102,8 @@ module.exports = function(RED) {
node.send(msg);
}
}
this.on("input",function(msg) {
this.on("input",function(m) {
msg = m;
var oids = node.oids || msg.oid;
if (oids) {
msg.oid = oids;

View File

@ -23,8 +23,8 @@ module.exports = function(RED) {
RED.nodes.createNode(this,n);
this.title = n.title;
var node = this;
this.on("input",function(msg) {
var titl = this.title || msg.topic;
node.on("input",function(msg) {
var titl = node.title || msg.topic;
if (typeof(msg.payload) == 'object') {
msg.payload = JSON.stringify(msg.payload);
}

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-notify",
"version" : "0.0.3",
"version" : "0.0.4",
"description" : "A Node-RED node to send local popup Notify alerts",
"dependencies" : {
"growl" : "1.8.1"

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-pusher",
"version" : "0.0.4",
"version" : "0.0.5",
"description" : "A Node-RED node to send and receive messages using Pusher.com",
"dependencies" : {
"pusher": "1.0.5",

View File

@ -39,7 +39,7 @@ module.exports = function(RED) {
//create a subscription to the channel and event defined by user
var socket = new PusherClient(''+this.appkey);
var my_channel = socket.subscribe(''+this.channel);
node.channel = socket.subscribe(''+this.channel);
socket.bind(''+this.eventname,
function(data) {
var msg = {topic:this.eventname};
@ -60,7 +60,6 @@ module.exports = function(RED) {
RED.nodes.createNode(this,n);
var node = this;
var credentials = this.credentials;
if ((credentials) && (credentials.hasOwnProperty("pusherappid"))) { this.appid = credentials.pusherappid; }
@ -80,25 +79,16 @@ module.exports = function(RED) {
secret: this.appsecret
});
this.on("input", function(msg) {
node.on("input", function(msg) {
pusher.trigger(this.channel, this.eventname, {
"payload": msg.payload
});
});
this.on("close", function() {
node.on("close", function() {
});
}
//debugging on the output:
var displayResult = function(result) {
node.log(result);
};
var displayError = function(err) {
node.log("Error: "+err);
};
RED.nodes.registerType("pusher in",PusherNode,{
credentials: {
pusherappkey_sub: "text"

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-timeswitch",
"version" : "0.0.4",
"version" : "0.0.5",
"description" : "A Node-RED node to provide a simple timeswitch to schedule daily on/off events.",
"dependencies" : {
"suncalc": "1.6.0"

View File

@ -370,7 +370,7 @@
url: "timeswitch/"+this.id,
type:"POST",
success: function(resp) {
RED.notify("Successfully injected: "+label,"success");
RED.notify("Successfully injected: ","success");
},
error: function(jqXHR,textStatus,errorThrown) {
if (jqXHR.status === 404) {