thing-it-device-enocean-ip
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -33,2 +33,8 @@ module.exports = { | ||
} | ||
}, { | ||
label: "Battery Failing", | ||
id: "batteryFailing", | ||
type: { | ||
id: "boolean" | ||
} | ||
}], | ||
@@ -66,8 +72,12 @@ events: [{ | ||
this.state = {temperature: 20.0}; | ||
this.state = {temperature1: 20.0, | ||
temperature2: 22.5, | ||
temperature3: 25.0, | ||
batteryFailing: false}; | ||
if (this.isSimulated()) { | ||
this.interval = setInterval(function () { | ||
this.state.temperature = Math.round(15 + Math.random() * 10); | ||
this.state.temperature1 = Math.round(15 + Math.random() * 10); | ||
this.state.temperature2 = Math.round(15 + Math.random() * 10); | ||
this.state.temperature3 = Math.round(15 + Math.random() * 10); | ||
this.publishStateChange(); | ||
@@ -88,18 +98,24 @@ }.bind(this), 20000); | ||
} | ||
else if (telegram.functions[n].key === 'temperature2') { | ||
if (telegram.functions[n].key === 'temperature2') { | ||
this.state.temperature1 = telegram.functions[n].value; | ||
this.publishStateChange(); | ||
} | ||
else if (telegram.functions[n].key === 'temperature3') { | ||
if (telegram.functions[n].key === 'temperature3') { | ||
this.state.temperature1 = telegram.functions[n].value; | ||
this.publishStateChange(); | ||
} | ||
else if (telegram.functions[n].key === 'temperatureInternal') { | ||
if (telegram.functions[n].key === 'temperatureInternal') { | ||
this.state.temperature1 = telegram.functions[n].value; | ||
this.publishStateChange(); | ||
} | ||
else if (telegram.functions[n].key === 'dyingGasp') { | ||
if (telegram.functions[n].key === 'dyingGasp') { | ||
if (telegram.functions[n].value === 'true') { | ||
this.state.batteryFailing = true; | ||
this.publishEvent('batteryDying', {}); | ||
this.publishStateChange(); | ||
} | ||
else{ | ||
this.state.batteryFailing = false; | ||
this.publishStateChange(); | ||
} | ||
} | ||
@@ -106,0 +122,0 @@ } |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ module.exports = { |
{ | ||
"name": "thing-it-device-enocean-ip", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "[thing-it-node] Device Plugin for EnOcean IP products.", | ||
@@ -5,0 +5,0 @@ "authors": "Marc Gille", |
@@ -0,0 +0,0 @@ # thing-it-device-enocean-ip |
@@ -0,0 +0,0 @@ const moment = require('moment') |
@@ -0,0 +0,0 @@ var assert = require("assert"); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
80068
24
1657