mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
naming fix
luxometer -> lux, luxNotify -> LuxNotify
This commit is contained in:
parent
538b210008
commit
a1d00f58ba
@ -30,6 +30,7 @@ function sensorTagNode(n) {
|
||||
this.accelerometer = n.accelerometer;
|
||||
this.magnetometer = n.magnetometer;
|
||||
this.gyroscope = n.gyroscope;
|
||||
this.lux = n.lux; // supported in sensortag 2
|
||||
this.keys = n.keys;
|
||||
|
||||
if (this.uuid === "") {
|
||||
@ -87,6 +88,12 @@ function sensorTagNode(n) {
|
||||
msg.payload = {'x': x, 'y': y, 'z': z};
|
||||
node.send(msg);
|
||||
});
|
||||
sensorTag.enableLux(function(){});
|
||||
sensorTag.on('LuxChange', function(lux){ // should be luxChange
|
||||
var msg = {'topic': node.topic + '/lux'};
|
||||
msg.payload = {'lux': lux};
|
||||
node.send(msg);
|
||||
});
|
||||
sensorTag.on('simpleKeyChange', function(left, right){
|
||||
var msg = {'topic': node.topic + '/keys'};
|
||||
msg.payload = {'left': left, 'right': right};
|
||||
@ -133,6 +140,11 @@ function enable(node) {
|
||||
} else {
|
||||
node.stag.unnotifyGyroscope(function() {});
|
||||
}
|
||||
if (node.lux) {
|
||||
node.stag.notifyLux(function() {});
|
||||
} else {
|
||||
node.stag.unnotifyLux(function() {});
|
||||
}
|
||||
if (node.keys) {
|
||||
node.stag.notifySimpleKey(function() {});
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user