thing-it-device-enocean-ip
Advanced tools
Comparing version 0.2.19 to 0.2.20
@@ -68,19 +68,16 @@ module.exports = { | ||
//dataArray = telegram.telegramInfo.data.match(/.{1,2}/g); | ||
//console.log("Data bits: ", dataArray[2]); | ||
for (n in telegram.functions) { | ||
if (telegram.functions[n].key === "trigger") { | ||
if (telegram.functions[n].value === "event") { | ||
this.state.lastOperation = "Button Pressed"; | ||
this.state.pressed = true; | ||
console.log(this.state); | ||
this.publishEvent('buttonPressed', {}); | ||
} else { | ||
this.state.lastOperation = "Button Released"; | ||
this.state.pressed = false; | ||
console.log(this.state); | ||
this.publishEvent('buttonReleased', {}); | ||
} | ||
} | ||
dataArray = telegram.telegramInfo.data.match(/.{1,2}/g); | ||
console.log("Data bits: ", dataArray[2]); | ||
if(dataArray[2] === "11") { | ||
this.state.lastOperation = "Button Pressed"; | ||
this.state.pressed = true; | ||
console.log(this.state); | ||
this.publishEvent('buttonPressed', {}); | ||
} | ||
else{ | ||
this.state.lastOperation = "Button Released"; | ||
this.state.pressed = false; | ||
console.log(this.state); | ||
this.publishEvent('buttonReleased', {}); | ||
} | ||
} | ||
@@ -87,0 +84,0 @@ }); |
{ | ||
"name": "thing-it-device-enocean-ip", | ||
"version": "0.2.19", | ||
"version": "0.2.20", | ||
"description": "[thing-it-node] Device Plugin for EnOcean IP products.", | ||
@@ -5,0 +5,0 @@ "authors": "Marc Gille", |
182028
4592