From d330ce9da5ca6083f7b531bbd9245d721ca53910 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Tue, 20 Oct 2015 19:30:25 +0100 Subject: [PATCH] Update blink1 node to use done() on close. --- hardware/blink1/77-blink1.js | 8 +++++--- hardware/blink1/package.json | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hardware/blink1/77-blink1.js b/hardware/blink1/77-blink1.js index 09c34f02..9982e26b 100644 --- a/hardware/blink1/77-blink1.js +++ b/hardware/blink1/77-blink1.js @@ -74,10 +74,12 @@ module.exports = function(RED) { } } catch (e) { node.error("Blink1 : device not found"); blink1 = null; } }); - this.on("close", function() { - if (blink1 && typeof blink1.close == "function") { - //blink1.close(); //This ought to work but seems to cause more hangs on closing than not... + this.on("close", function(done) { + if (blink1 && typeof blink1.close === "function") { + //This ought to work but seems to cause more hangs on closing than not... + blink1.close(function() { done() }); } + else { done(); } blink1 = null; }); } diff --git a/hardware/blink1/package.json b/hardware/blink1/package.json index 56c09609..e3858f87 100644 --- a/hardware/blink1/package.json +++ b/hardware/blink1/package.json @@ -1,9 +1,9 @@ { "name" : "node-red-node-blink1", - "version" : "0.0.9", + "version" : "0.0.11", "description" : "A Node-RED node to control a Thingm Blink(1)", "dependencies" : { - "node-blink1" : "0.2.1" + "node-blink1" : "0.2.2" }, "repository" : { "type":"git",