mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-08 05:31:55 +00:00
ignore hiddent Home Assistant devices
This commit is contained in:
@@ -152,15 +152,24 @@ HomeAssistantPlatform.prototype = {
|
||||
entity = data[i]
|
||||
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) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// ignore hidden devices
|
||||
if (entity.attributes && entity.attributes.hidden) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var accessory = null
|
||||
|
||||
if (entity_type == 'light') {
|
||||
accessory = new HomeAssistantLight(that.log, entity, that)
|
||||
}else if (entity_type == 'switch'){
|
||||
console.log(JSON.stringify(entity))
|
||||
console.log("");
|
||||
console.log("");
|
||||
accessory = new HomeAssistantSwitch(that.log, entity, that)
|
||||
}else if (entity_type == 'scene'){
|
||||
accessory = new HomeAssistantSwitch(that.log, entity, that, 'scene')
|
||||
|
||||
Reference in New Issue
Block a user