homebridge-syntex-webhooks
Advanced tools
Comparing version 1.0.5-b35 to 1.0.5-b36
42
index.js
@@ -195,3 +195,3 @@ var request = require('request'); | ||
this.id = sensorConfig["id"]; | ||
this.name = sensorConfig["name"]; | ||
this.sensorName = sensorConfig["name"]; | ||
this.type = sensorConfig["type"]; | ||
@@ -201,7 +201,7 @@ | ||
{ | ||
this.service = new Service.ContactSensor(this.name); | ||
this.service = new Service.ContactSensor(this.sensorName); | ||
this.changeHandler = (function(newState) | ||
{ | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.name + "' geändert zu '" + newState + "' ( " + this.mac + " )"); | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.sensorName + "' geändert zu '" + newState + "' ( " + this.mac + " )"); | ||
this.service.getCharacteristic(Characteristic.ContactSensorState).updateValue(newState ? Characteristic.ContactSensorState.CONTACT_DETECTED : Characteristic.ContactSensorState.CONTACT_NOT_DETECTED); | ||
@@ -214,7 +214,7 @@ }).bind(this); | ||
{ | ||
this.service = new Service.MotionSensor(this.name); | ||
this.service = new Service.MotionSensor(this.sensorName); | ||
this.changeHandler = (function(newState) | ||
{ | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.name + "' geändert zu '" + newState + "' ( " + this.mac + " )"); | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.sensorName + "' geändert zu '" + newState + "' ( " + this.mac + " )"); | ||
this.service.getCharacteristic(Characteristic.MotionDetected).updateValue(newState); | ||
@@ -227,7 +227,7 @@ }).bind(this); | ||
{ | ||
this.service = new Service.TemperatureSensor(this.name); | ||
this.service = new Service.TemperatureSensor(this.sensorName); | ||
this.changeHandler = (function(newState) | ||
{ | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.name + "' geändert zu '" + newState + "' ( " + this.mac + " )"); | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.sensorName + "' geändert zu '" + newState + "' ( " + this.mac + " )"); | ||
this.service.getCharacteristic(Characteristic.CurrentTemperature).updateValue(newState); | ||
@@ -243,7 +243,7 @@ }).bind(this); | ||
{ | ||
this.service = new Service.HumiditySensor(this.name); | ||
this.service = new Service.HumiditySensor(this.sensorName); | ||
this.changeHandler = (function(newState) | ||
{ | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.name + "' geändert zu '" + newState + "' ( " + this.mac + " )"); this.service.getCharacteristic(Characteristic.CurrentRelativeHumidity).updateValue(newState); | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.sensorName + "' geändert zu '" + newState + "' ( " + this.mac + " )"); this.service.getCharacteristic(Characteristic.CurrentRelativeHumidity).updateValue(newState); | ||
}).bind(this); | ||
@@ -255,7 +255,7 @@ | ||
{ | ||
this.service = new Service.LeakSensor(this.name); | ||
this.service = new Service.LeakSensor(this.sensorName); | ||
this.changeHandler = (function(newState) | ||
{ | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.name + "' geändert zu '" + newState + "' ( " + this.mac + " )"); | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.sensorName + "' geändert zu '" + newState + "' ( " + this.mac + " )"); | ||
this.service.getCharacteristic(Characteristic.LeakDetected).updateValue(newState); | ||
@@ -268,7 +268,7 @@ }).bind(this); | ||
{ | ||
this.service = new Service.LightSensor(this.name); | ||
this.service = new Service.LightSensor(this.sensorName); | ||
this.changeHandler = (function(newState) | ||
{ | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.name + "' geändert zu '" + newState + "' ( " + this.mac + " )"); this.service.getCharacteristic(Characteristic.CurrentAmbientLightLevel).updateValue(parseFloat(newState)); | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.sensorName + "' geändert zu '" + newState + "' ( " + this.mac + " )"); this.service.getCharacteristic(Characteristic.CurrentAmbientLightLevel).updateValue(parseFloat(newState)); | ||
}).bind(this); | ||
@@ -281,3 +281,3 @@ | ||
{ | ||
this.service = new Service.OccupancySensor(this.name); | ||
this.service = new Service.OccupancySensor(this.sensorName); | ||
@@ -293,3 +293,3 @@ this.changeHandler = (function(newState) | ||
{ | ||
this.service = new Service.SmokeSensor(this.name); | ||
this.service = new Service.SmokeSensor(this.sensorName); | ||
@@ -306,3 +306,3 @@ this.changeHandler = (function(newState) | ||
{ | ||
this.service = new Service.AirQualitySensor(this.name); | ||
this.service = new Service.AirQualitySensor(this.sensorName); | ||
@@ -344,3 +344,3 @@ this.changeHandler = (function(newState) | ||
{ | ||
log('\x1b[36m%s\x1b[0m', "[READ]", "HomeKit Status für '" + this.name + "' ist '" + state + "'"); | ||
log('\x1b[36m%s\x1b[0m', "[READ]", "HomeKit Status für '" + this.sensorName + "' ist '" + state + "'"); | ||
} | ||
@@ -388,3 +388,3 @@ | ||
this.id = switchConfig["id"]; | ||
this.name = switchConfig["name"]; | ||
this.sensorName = switchConfig["name"]; | ||
this.onURL = switchConfig["on_url"] || ""; | ||
@@ -401,7 +401,7 @@ this.onMethod = switchConfig["on_method"] || "GET"; | ||
this.service = new Service.Switch(this.name); | ||
this.service = new Service.Switch(this.sensorName); | ||
this.changeHandler = (function(newState) | ||
{ | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.name + "' geändert zu '" + newState + "' ( " + this.mac + " )"); | ||
log('\x1b[36m%s\x1b[0m', "[UPDATE]", "HomeKit Status für '" + this.sensorName + "' geändert zu '" + newState + "' ( " + this.mac + " )"); | ||
this.service.getCharacteristic(Characteristic.On).updateValue(newState); | ||
@@ -427,3 +427,3 @@ }).bind(this); | ||
{ | ||
log('\x1b[36m%s\x1b[0m', "[READ]", "HomeKit Status für '" + this.name + "' ist '" + state + "'"); | ||
log('\x1b[36m%s\x1b[0m', "[READ]", "HomeKit Status für '" + this.sensorName + "' ist '" + state + "'"); | ||
} | ||
@@ -430,0 +430,0 @@ |
{ | ||
"name": "homebridge-syntex-webhooks", | ||
"version": "1.0.5-b35", | ||
"version": "1.0.5-b36", | ||
"description": "A webhook plugin for HTTP devices", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
56740