diff --git a/hardware/sensorTag/79-sensorTag.html b/hardware/sensorTag/79-sensorTag.html index 5bcbb092..19d21eb8 100644 --- a/hardware/sensorTag/79-sensorTag.html +++ b/hardware/sensorTag/79-sensorTag.html @@ -33,9 +33,13 @@
- +
+
+ + +
@@ -85,6 +89,7 @@ defaults: { // defines the editable properties of the node name: {value:"sensorTag"}, // along with default values. topic: {value:"sensorTag"}, + uuid: {value:undefined}, temperature: {value:true}, humidity: {value:true}, pressure: {value:true}, @@ -101,6 +106,16 @@ }, labelStyle: function() { // sets the class to apply to the label return this.name?"node_label_italic":""; + }, + oneditsave: function() { + var mac = $("#node-input-uuid").val(); + //nasty hack as I can't get global replace to work + mac = mac.replace(/:/gi,''); + mac = mac.replace(/:/gi,''); + mac = mac.replace(/:/gi,''); + mac = mac.replace(/:/gi,''); + mac = mac.toLowerCase(); + $("#node-input-uuid").val(mac); } }); diff --git a/hardware/sensorTag/79-sensorTag.js b/hardware/sensorTag/79-sensorTag.js index c1252983..61dbc24b 100644 --- a/hardware/sensorTag/79-sensorTag.js +++ b/hardware/sensorTag/79-sensorTag.js @@ -25,6 +25,7 @@ function sensorTagNode(n) { RED.nodes.createNode(this,n); this.name = n.name; this.topic = n.topic; + this.uuid = n.uuid; this.temperature = n.temperature; this.pressure = n.pressure; this.humidity = n.humidity; @@ -32,6 +33,12 @@ function sensorTagNode(n) { this.magnetometer = n.magnetometer; this.gyroscope = n.gyroscope; this.keys = n.keys; + + if (this.uuid === "") { + this.uuid = undefined; + } + console.log(this.uuid); + node=this; if ( typeof stag == "undefined") { @@ -90,7 +97,7 @@ function sensorTagNode(n) { enable(); }); }); - }); + },node.uuid); } else { //console.log("reconfig"); enable(); diff --git a/hardware/sensorTag/README b/hardware/sensorTag/README index b524fc69..2d6657ab 100644 --- a/hardware/sensorTag/README +++ b/hardware/sensorTag/README @@ -1,5 +1,5 @@ -This currently requires a slightly modified sensortag library +This currently requires the sensortag library To install use the following command in the Node-Red directory -npm install sensortag@https://api.github.com/repos/hardillb/node-sensortag/tarball +npm install sensortag