cleanup of sample.json and platform shim

removed non-existent old device types from platform shim.
This commit is contained in:
Snowdd1
2015-09-06 11:41:33 +02:00
parent 09516acaf3
commit 9d8afc4bcb
2 changed files with 119 additions and 104 deletions

View File

@@ -1,88 +1,121 @@
{ {
"bridge": { "bridge": {
"name": "Homebridge", "name": "Homebridge",
"username": "CC:22:3D:E3:CE:30", "username": "CC:22:3D:E3:CE:30",
"port": 51826, "port": 51826,
"pin": "031-45-154" "pin": "031-45-154"
}, },
"description": "This is an example configuration file for KNX platform shim", "description": "This is an example configuration file for KNX platform shim",
"platforms": "hint": "Always paste into jsonlint.com validation page before starting your homebridge, saves a lot of frustration",
[ "platforms": [
{ {
"platform": "KNX", "platform": "KNX",
"name": "KNX", "name": "KNX",
"knxd_ip": "192.168.178.205", "knxd_ip": "192.168.178.205",
"knxd_port": 6720, "knxd_port": 6720,
"accessories": "accessories": [
[ {
{ "accessory_type": "knxdevice",
"accessory_type": "knxdevice", "description": "Only generic type knxdevice is supported, all previous knx type have been merged into that.",
"name": "Living Room North Lamp", "name": "Living Room North Lamp",
"services": "services": [
[ {
{ "type": "Lightbulb",
"type": "Lightbulb", "description": "iOS8 Lightbulb type, supports On (Switch) and Brightness",
"name": "Living Room North Lamp", "name": "Living Room North Lamp",
"On": { "On": {
"Set": "1/1/6", "Set": "1/1/6",
"Listen": [ "Listen": [
"1/1/63" "1/1/63"
] ]
}, },
"Brightness": { "Brightness": {
"Set": "1/1/62", "Set": "1/1/62",
"Listen": [ "Listen": [
"1/1/64" "1/1/64"
] ]
} }
} }
] ],
}, "services-description": "Services is an array, you CAN have multiple service types in one accessory, though it is not fully supported in many iOS HK apps, such as EVE and myTouchHome"
{ },
"accessory_type": "knxdevice", {
"name": "Office", "accessory_type": "knxdevice",
"services": "name": "Office Temperature",
[ "description": "iOS8.4.1 TemperatureSensor type, supports CurrentTemperature",
{ "services": [
"type": "Lightbulb", {
"name": "Office Lamp", "type": "TemperatureSensor",
"On": { "name": "Raumtemperatur",
"Set": "1/3/5" "CurrentTemperature": {
} "Listen": "3/3/44"
}, }
{ }
"type": "Thermostat", ]
"name": "Raumtemperatur", },
"CurrentTemperature": { {
"Listen": "3/3/44" "accessory_type": "knxdevice",
}, "name": "Office Window Lock",
"TargetTemperature": { "services": [
"Set": "3/3/94" {
}, "type": "LockMechanism",
"CurrentHeatingCoolingState": { "description": "iOS8 Lock mechanism, Supports LockCurrentStateSecured0 OR LockCurrentState, LockTargetStateSecured0 OR LockTargetState, use depending if LOCKED is 0 or 1",
"Listen": "3/3/64" "name": "Office Window Lock",
} "LockCurrentStateSecured0": {
}, "Listen": "5/3/15"
{ },
"type": "WindowCovering", "LockTargetStateSecured0": {
"name": "Rollo", "Listen": "5/3/15"
"Target": { }
"Set": "address", }
"Listen": "adresses" ]
}, },
"Current": { {
"Set": "address", "accessory_type": "knxdevice",
"Listen": "adresses" "description":"sample device with multiple services. Multiple services of different types are widely supported"
}, "name": "Office",
"PositionState": { "services": [
"Listen": "adresses" {
} "type": "Lightbulb",
} "name": "Office Lamp",
] "On": {
} "Set": "1/3/5"
] }
} },
], {
"accessories": [], "type": "Thermostat",
"prototyping": {} "description": "iOS8 Thermostat type, supports CurrentTemperature, TargetTemperature, CurrentHeatingCoolingState ",
"name": "Raumtemperatur",
"CurrentTemperature": {
"Listen": "3/3/44"
},
"TargetTemperature": {
"Set": "3/3/94"
},
"CurrentHeatingCoolingState": {
"Listen": "3/3/64"
}
},
{
"type": "WindowCovering",
"description": "iOS9 Window covering (blinds etc) type, still WIP",
"name": "Blinds",
"Target": {
"Set": "address",
"Listen": "adresses"
},
"Current": {
"Set": "address",
"Listen": "adresses"
},
"PositionState": {
"Listen": "adresses"
}
}
]
}
]
}
],
"accessories": []
} }

View File

@@ -47,24 +47,6 @@ KNXPlatform.prototype = {
this.log("created "+acc.name+" universal accessory"); this.log("created "+acc.name+" universal accessory");
myAccessories.push(acc); myAccessories.push(acc);
break; break;
case "knxlamp":
this.log("push new lamp with "+foundAccessories[int].name );
foundAccessories[int].knxd_ip = this.config.knxd_ip;
foundAccessories[int].knxd_port = this.config.knxd_port;
var accConstructor = require('./../accessories/knxlamp.js');
var acc = new accConstructor.accessory(this.log,foundAccessories[int]);
this.log("created "+acc.name+" accessory");
myAccessories.push(acc);
break;
case "knxthermostat":
this.log("push new thermostat with "+foundAccessories[int].name);
foundAccessories[int].knxd_ip = this.config.knxd_ip;
foundAccessories[int].knxd_port = this.config.knxd_port;
var accConstructor = require('./../accessories/knxthermostat.js');
var acc = new accConstructor.accessory(this.log,foundAccessories[int]);
this.log("created "+acc.name+" accessory");
myAccessories.push(acc);
break;
default: default:
// do something else // do something else
this.log("unkown accessory type found") this.log("unkown accessory type found")