mirror of
https://github.com/mtan93/homebridge.git
synced 2026-04-16 06:13:10 +01:00
Merge remote-tracking branch 'nfarina/master' into knx-dev
This commit is contained in:
@@ -89,14 +89,19 @@
|
|||||||
"delay": 30,
|
"delay": 30,
|
||||||
"repeat": 3,
|
"repeat": 3,
|
||||||
"zones":["Kitchen Lamp","Bedroom Lamp","Living Room Lamp","Hallway Lamp"]
|
"zones":["Kitchen Lamp","Bedroom Lamp","Living Room Lamp","Hallway Lamp"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"platform": "HomeAssistant",
|
"platform": "HomeAssistant",
|
||||||
"name": "HomeAssistant",
|
"name": "HomeAssistant",
|
||||||
"host": "http://192.168.1.10:8123",
|
"host": "http://192.168.1.10:8123",
|
||||||
"password": "XXXXX",
|
"password": "XXXXX",
|
||||||
"supported_types": ["light", "switch", "media_player", "scene"]
|
"supported_types": ["light", "switch", "media_player", "scene"]
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"platform": "LIFx",
|
||||||
|
"name": "LIFx",
|
||||||
|
"access_token": "XXXXXXXX generate at https://cloud.lifx.com/settings"
|
||||||
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
"accessories": [
|
"accessories": [
|
||||||
|
|||||||
@@ -152,15 +152,24 @@ HomeAssistantPlatform.prototype = {
|
|||||||
entity = data[i]
|
entity = data[i]
|
||||||
entity_type = entity.entity_id.split('.')[0]
|
entity_type = entity.entity_id.split('.')[0]
|
||||||
|
|
||||||
|
// ignore devices that are not in the list of supported types
|
||||||
if (that.supportedTypes.indexOf(entity_type) == -1) {
|
if (that.supportedTypes.indexOf(entity_type) == -1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ignore hidden devices
|
||||||
|
if (entity.attributes && entity.attributes.hidden) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
var accessory = null
|
var accessory = null
|
||||||
|
|
||||||
if (entity_type == 'light') {
|
if (entity_type == 'light') {
|
||||||
accessory = new HomeAssistantLight(that.log, entity, that)
|
accessory = new HomeAssistantLight(that.log, entity, that)
|
||||||
}else if (entity_type == 'switch'){
|
}else if (entity_type == 'switch'){
|
||||||
|
console.log(JSON.stringify(entity))
|
||||||
|
console.log("");
|
||||||
|
console.log("");
|
||||||
accessory = new HomeAssistantSwitch(that.log, entity, that)
|
accessory = new HomeAssistantSwitch(that.log, entity, that)
|
||||||
}else if (entity_type == 'scene'){
|
}else if (entity_type == 'scene'){
|
||||||
accessory = new HomeAssistantSwitch(that.log, entity, that, 'scene')
|
accessory = new HomeAssistantSwitch(that.log, entity, that, 'scene')
|
||||||
|
|||||||
Reference in New Issue
Block a user