thing-it-device-enocean-ip
Advanced tools
Comparing version 0.2.17 to 0.2.18
@@ -9,3 +9,34 @@ module.exports = { | ||
services: [], | ||
state: [{label: 'Last Operation', id: 'lastOperation'}], | ||
state: [{ | ||
label: 'Last Operation', | ||
id: 'lastOperation' | ||
}, { | ||
label: 'Last Operation Timestamp', | ||
id: 'lastOperationTimestamp' | ||
}, { | ||
label: 'Button A0', | ||
id: 'buttonA0', | ||
type:{ | ||
id: "boolean" | ||
} | ||
}, { | ||
label: 'Button AI', | ||
id: 'buttonAI', | ||
type:{ | ||
id: "boolean" | ||
} | ||
}, { | ||
label: 'Button B0', | ||
id: 'buttonB0', | ||
type:{ | ||
id: "boolean" | ||
} | ||
}, { | ||
label: 'Button BI', | ||
id: 'buttonBI', | ||
type:{ | ||
id: "boolean" | ||
} | ||
} | ||
], | ||
events: [{ | ||
@@ -89,6 +120,18 @@ label: 'Button A0 Pressed', | ||
if (telegram.functions[n].key.indexOf('button') === 0) { | ||
if (telegram.functions[n].key === 'buttonA0'){ | ||
this.state.buttonA0 = telegram.functions[n].value === 'pressed'; | ||
} | ||
if (telegram.functions[n].key === 'buttonAI'){ | ||
this.state.buttonAI = telegram.functions[n].value === 'pressed'; | ||
} | ||
if (telegram.functions[n].key === 'buttonB0'){ | ||
this.state.buttonB0 = telegram.functions[n].value === 'pressed'; | ||
} | ||
if (telegram.functions[n].key === 'buttonBI'){ | ||
this.state.buttonBI = telegram.functions[n].value === 'pressed'; | ||
} | ||
this.publishEvent(telegram.functions[n].key + capitalizeFirstLetter(telegram.functions[n].value), {}); | ||
this.state.lastOperation = capitalizeFirstLetter(telegram.functions[n].key) + ' ' + capitalizeFirstLetter(telegram.functions[n].value); | ||
this.state.lastOperationTimestamp = moment().toISOString(); | ||
this.publishStateChange(); | ||
@@ -95,0 +138,0 @@ } |
{ | ||
"name": "thing-it-device-enocean-ip", | ||
"version": "0.2.17", | ||
"version": "0.2.18", | ||
"description": "[thing-it-node] Device Plugin for EnOcean IP products.", | ||
@@ -5,0 +5,0 @@ "authors": "Marc Gille", |
@@ -14,2 +14,3 @@ var assert = require("assert"); | ||
testDriver.registerUnitPlugin(__dirname + "/../default-units/temperatureSensor"); | ||
testDriver.registerUnitPlugin(__dirname + "/../default-units/opus_D2-05-02") | ||
}); | ||
@@ -16,0 +17,0 @@ describe('Start Configuration', function () { |
182292
56
4595