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

Merge pull request #21 from andypiper/blink-fix

Blink1 fix -  only initialise once....
This commit is contained in:
Dave Conway-Jones 2014-01-14 02:56:58 -08:00
commit f61b8ae034

View File

@ -16,6 +16,7 @@
var RED = require(process.env.NODE_RED_HOME+"/red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var Blink1 = require("node-blink1"); var Blink1 = require("node-blink1");
var blink1 = new Blink1.Blink1();
function Blink1Node(n) { function Blink1Node(n) {
RED.nodes.createNode(this,n); RED.nodes.createNode(this,n);
@ -64,12 +65,11 @@ function Blink1Node(n) {
} }
}); });
//This ought to work but seems to cause more hangs on closing than not... //This ought to work but seems to cause more hangs on closing than not...
//this.on("close", function() { this.on("close", function() {
//if (blink1 && typeof blink1.close == "function") { if (blink1 && typeof blink1.close == "function") {
//blink1.close(); blink1.close();
//} }
//}); });
var blink1 = new Blink1.Blink1();
} }
catch(e) { catch(e) {
node.error("No Blink1 found (" + e + ")"); node.error("No Blink1 found (" + e + ")");