mirror of
https://github.com/mtan93/homebridge.git
synced 2026-04-14 14:23:10 +01:00
Added Door/Window sensors and ancillary temperature sensors.
Door/Window sensors are still implemented as garage door openers, because that seems to make the most sense at the moment.
This commit is contained in:
@@ -80,7 +80,7 @@ ZWayServerPlatform.prototype = {
|
|||||||
opts.headers = {
|
opts.headers = {
|
||||||
"Cookie": "ZWAYSession=" + this.sessionId
|
"Cookie": "ZWAYSession=" + this.sessionId
|
||||||
};
|
};
|
||||||
opts.proxy = 'http://localhost:8888';
|
//opts.proxy = 'http://localhost:8888';
|
||||||
|
|
||||||
request(opts, function(error, response, body){
|
request(opts, function(error, response, body){
|
||||||
if(response.statusCode == 401){
|
if(response.statusCode == 401){
|
||||||
@@ -88,7 +88,7 @@ opts.proxy = 'http://localhost:8888';
|
|||||||
request({
|
request({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: that.url + 'ZAutomation/api/v1/login',
|
url: that.url + 'ZAutomation/api/v1/login',
|
||||||
proxy: 'http://localhost:8888',
|
//proxy: 'http://localhost:8888',
|
||||||
body: { //JSON.stringify({
|
body: { //JSON.stringify({
|
||||||
"form": true,
|
"form": true,
|
||||||
"login": that.login,
|
"login": that.login,
|
||||||
@@ -275,7 +275,7 @@ ZWayServerAccessory.prototype = {
|
|||||||
services.push(new Service.TemperatureSensor(vdev.metrics.title));
|
services.push(new Service.TemperatureSensor(vdev.metrics.title));
|
||||||
break;
|
break;
|
||||||
case "sensorBinary.Door/Window":
|
case "sensorBinary.Door/Window":
|
||||||
//services.push(new Service.GarageDoorOpener(vdev.metrics.title));
|
services.push(new Service.GarageDoorOpener(vdev.metrics.title));
|
||||||
break;
|
break;
|
||||||
case "battery.Battery":
|
case "battery.Battery":
|
||||||
services.push(new Service.BatteryService(vdev.metrics.title));
|
services.push(new Service.BatteryService(vdev.metrics.title));
|
||||||
@@ -611,6 +611,12 @@ ZWayServerAccessory.prototype = {
|
|||||||
services = services.concat(this.getVDevServices(this.devDesc.devices[this.devDesc.types["battery.Battery"]]));
|
services = services.concat(this.getVDevServices(this.devDesc.devices[this.devDesc.types["battery.Battery"]]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Odds and ends...if there are sensors that haven't been used, add services for them...
|
||||||
|
var tempSensor = this.devDesc.types["sensorMultilevel.Temperature"] !== undefined ? this.devDesc.devices[this.devDesc.types["sensorMultilevel.Temperature"]] : false;
|
||||||
|
if(tempSensor && !this.platform.cxVDevMap[tempSensor.id]){
|
||||||
|
services = services.concat(this.getVDevServices(tempSensor));
|
||||||
|
}
|
||||||
|
|
||||||
debug("Loaded services for " + this.name);
|
debug("Loaded services for " + this.name);
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user