Fixed device buttons
This commit is contained in:
23
src/index.ts
23
src/index.ts
@@ -3,6 +3,7 @@ import HarmonyDataProvider from "./DataProviders/HarmonyDataProvider";
|
||||
import * as Config from "./Models/Config";
|
||||
import { IDevice } from "./Models";
|
||||
import { HarmonyDevice } from "./Models/HarmonyDevice";
|
||||
import { HarmonyHub } from "./Models/HarmonyHub";
|
||||
|
||||
let Accessory: any;
|
||||
let Homebridge: any;
|
||||
@@ -51,18 +52,18 @@ class HarmonyMatrixPlatform {
|
||||
if (this.config.EmitDevicesOnStartup) {
|
||||
this.dataProvider.on("Ready", () => {
|
||||
|
||||
// TODO const hubs: { [hubName: string]: { [deviceName: string]: HarmonyDevice } } = this.dataProvider!.devicesByHub;
|
||||
// Object.keys(hubs).forEach((hubName: string) => {
|
||||
// const deviceDictionary = hubs[hubName];
|
||||
// this.log(`${hubName}`)
|
||||
const hubs = this.dataProvider!.hubs;
|
||||
Object.values(hubs).forEach((hub: HarmonyHub) => {
|
||||
const deviceDictionary = hub.devices;
|
||||
this.log(`${hub.hubName}`)
|
||||
|
||||
// Object.values(deviceDictionary).forEach((device: HarmonyDevice) => {
|
||||
// this.log(` ${device.name} : ${device.id}`);
|
||||
// Object.keys(device.commands).forEach((command: string) => {
|
||||
// this.log(` ${command}`);
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
Object.values(deviceDictionary).forEach((device: HarmonyDevice) => {
|
||||
this.log(` ${device.name} : ${device.id}`);
|
||||
Object.keys(device.commands).forEach((command: string) => {
|
||||
this.log(` ${command}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user