sensor tag - only disconnect once...

still to close #196
This commit is contained in:
Dave Conway-Jones 2016-04-01 16:41:58 +01:00
parent 98d44004c9
commit a8ec48553f
2 changed files with 2 additions and 3 deletions

View File

@ -49,7 +49,7 @@ module.exports = function(RED) {
node.log("connected to sensor tag: " + sensorTag._peripheral.uuid); node.log("connected to sensor tag: " + sensorTag._peripheral.uuid);
node.status({fill:"green", shape:"dot", text:"connected"}); node.status({fill:"green", shape:"dot", text:"connected"});
sensorTag.on('disconnect', function() { sensorTag.once('disconnect', function() {
node.discovering = false; node.discovering = false;
node.status({fill:"red", shape:"ring", text:"disconnected"}); node.status({fill:"red", shape:"ring", text:"disconnected"});
node.log("disconnected ",node.uuid); node.log("disconnected ",node.uuid);
@ -102,7 +102,6 @@ module.exports = function(RED) {
msg.payload = {'left': left, 'right': right, 'magnet': mag}; msg.payload = {'left': left, 'right': right, 'magnet': mag};
node.send(msg); node.send(msg);
}); });
sensorTag.on('luxometerChange', function(lux) { sensorTag.on('luxometerChange', function(lux) {
var msg = {'topic': node.topic + '/luxometer'}; var msg = {'topic': node.topic + '/luxometer'};
msg.payload = {'lux': parseInt(lux)}; msg.payload = {'lux': parseInt(lux)};

View File

@ -1,7 +1,7 @@
{ {
"name": "node-red-node-sensortag", "name": "node-red-node-sensortag",
"description": "A Node-RED node to read data from a TI SensorTag", "description": "A Node-RED node to read data from a TI SensorTag",
"version": "0.0.13", "version": "0.0.14",
"keywords": [ "keywords": [
"node-red", "node-red",
"sensortag", "sensortag",