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

Fix listing errors in node-red-nodes

This commit is contained in:
Dave Conway-Jones 2016-03-01 21:10:58 +00:00
parent ea9356a3cc
commit d70ae82d10
9 changed files with 50 additions and 48 deletions

View File

@ -55,8 +55,8 @@ module.exports = function(RED) {
}
else if (p3.test(msg.payload)) {
// if it is a r,g,b,index quad for a two led device
var rgb = msg.payload.split(',');
blink1[node.serial||"one"].fadeToRGB(node.fade, parseInt(rgb[0])&255, parseInt(rgb[1])&255, parseInt(rgb[2])&255, parseInt(rgb[3])&3);
var rgb2 = msg.payload.split(',');
blink1[node.serial||"one"].fadeToRGB(node.fade, parseInt(rgb2[0])&255, parseInt(rgb2[1])&255, parseInt(rgb2[2])&255, parseInt(rgb2[3])&3);
}
else {
// you can add fancy colours by name here if you want...

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-blink1",
"version" : "0.0.14",
"version" : "0.0.15",
"description" : "A Node-RED node to control a Thingm Blink(1)",
"dependencies" : {
"node-blink1" : "0.2.2"

View File

@ -40,7 +40,7 @@ module.exports = function(RED) {
// the magic to make python print stuff immediately
process.env.PYTHONUNBUFFERED = 1;
function piNeopixelNode(n) {
function PiNeopixelNode(n) {
RED.nodes.createNode(this,n);
this.pixels = n.pixels || 1;
this.bgnd = n.bgnd || "0,0,0";
@ -86,13 +86,13 @@ module.exports = function(RED) {
else { node.warn("Invalid payload : "+pay); return; }
}
else { // it's a single number so just draw bar
var l = pay;
if (node.mode.indexOf("pcent") >= 0) { l = parseInt(l / 100 * node.pixels + 0.5); }
l = l - 1;
var ll = pay;
if (node.mode.indexOf("pcent") >= 0) { ll = parseInt(ll / 100 * node.pixels + 0.5); }
ll = ll - 1;
if (node.mode.indexOf("need") >= 0) {
pay = "0,"+(l-1)+","+node.fgnd+"\n"+l+","+needle+"\n"+(l+1)+","+(node.pixels-1)+","+node.bgnd;
pay = "0,"+(ll-1)+","+node.fgnd+"\n"+ll+","+needle+"\n"+(ll+1)+","+(node.pixels-1)+","+node.bgnd;
} else {
pay = "0,"+l+","+node.fgnd+"\n"+(l+1)+","+(node.pixels-1)+","+node.bgnd;
pay = "0,"+ll+","+node.fgnd+"\n"+(ll+1)+","+(node.pixels-1)+","+node.bgnd;
}
}
}
@ -165,5 +165,5 @@ module.exports = function(RED) {
}
}
}
RED.nodes.registerType("rpi-neopixels",piNeopixelNode);
RED.nodes.registerType("rpi-neopixels",PiNeopixelNode);
}

View File

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

View File

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

View File

@ -50,7 +50,6 @@
<script type="text/javascript">
RED.nodes.registerType('rpi-unicorn',{
category: 'Raspberry Pi',
label: 'Raspberry Pi',
color:"#c6dbef",
defaults: {
name: { value:"" },

View File

@ -92,6 +92,7 @@ module.exports = function(RED) {
else { ready = true; }
function inputlistener(msg) {
var a,b,c,d,e;
var s = msg.payload.toUpperCase().split(",");
var doDraw = true;
if (s.length === 1) {
@ -131,10 +132,10 @@ module.exports = function(RED) {
else {
node.child.stdin.write('P'+msg.payload+'\n');
doDraw = false;
for (var a=0; a<s.length; a++) {
for (a=0; a<s.length; a++) {
//console.log("PIXELS",a);
if ((s[a] === "*") && (s[a+1] === "*")) {
for (var c=0; c<192; c++) {
for (c=0; c<192; c++) {
pic[c] = s[a+2];
pic[c+1] = s[a+3];
pic[c+2] = s[a+4];
@ -142,14 +143,14 @@ module.exports = function(RED) {
}
}
else if (s[a] === "*") {
for (var d=0; d<8; d++) {
for (d=0; d<8; d++) {
pic[d*3+s[1]*24] = s[a+2];
pic[d*3+s[1]*24+1] = s[a+3];
pic[d*3+s[1]*24+2] = s[a+4];
}
}
else if (s[a+1] === "*") {
for (var e=0; e<8; e++) {
for (e=0; e<8; e++) {
pic[s[a]*3+e*24] = s[a+2];
pic[s[a]*3+e*24+1] = s[a+3];
pic[s[a]*3+e*24+2] = s[a+4];
@ -165,11 +166,11 @@ module.exports = function(RED) {
}
}
else if (s.length === 192) { // handle complete buffer refresh.
for (var i=0; i<192; i++) {
pic[i] = s[i];
pic[i+1] = s[i+1];
pic[i+2] = s[i+2];
i += 2;
for (var h=0; h<192; h++) {
pic[h] = s[h];
pic[h+1] = s[h+1];
pic[h+2] = s[h+2];
h += 2;
}
}
else {
@ -180,17 +181,18 @@ module.exports = function(RED) {
var pixels = new Buffer(192);
pic.copy(pixels);
for (var p in node.items) {
var b = node.items[p].split(",");
for (var a=0; a<b.length; a++) {
if (node.items.hasOwnProperty(p)) {
b = node.items[p].split(",");
for (a=0; a<b.length; a++) {
if (b[a] === "*") {
for (var d=0; d<8; d++) {
for (d=0; d<8; d++) {
pixels[d*3+b[a+1]*24] = b[a+2];
pixels[d*3+b[a+1]*24+1] = b[a+3];
pixels[d*3+b[a+1]*24+2] = b[a+4];
}
}
else if (b[a+1] === "*") {
for (var e=0; e<8; e++) {
for (e=0; e<8; e++) {
pixels[b[a]*3+e*24] = b[a+2];
pixels[b[a]*3+e*24+1] = b[a+3];
pixels[b[a]*3+e*24+2] = b[a+4];
@ -204,6 +206,7 @@ module.exports = function(RED) {
a += 4;
}
}
}
node.child.stdin.write(pixels);
node.child.stdin.write("\n");
}

View File

@ -44,7 +44,7 @@ module.exports = function(RED) {
var pri = msg.priority||this.priority;
var url = this.url||msg.url;
var options = { priority:pri };
if (url) { options.url = url };
if (url) { options.url = url; }
if (typeof(msg.payload) === 'object') {
msg.payload = JSON.stringify(msg.payload);
}

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-prowl",
"version" : "0.0.5",
"version" : "0.0.6",
"description" : "A Node-RED node to send alerts via Prowl",
"dependencies" : {
"node-prowl" : "0.1.7"