Successful multi hub

This commit is contained in:
watsonb8
2020-01-24 21:31:43 -05:00
parent ec0c857c97
commit 97c0f625db
4 changed files with 106 additions and 72 deletions

View File

@@ -51,18 +51,18 @@ class HarmonyMatrixPlatform {
if (this.config.EmitDevicesOnStartup) {
this.dataProvider.on("Ready", () => {
const hubs: { [hubName: string]: { [deviceName: string]: HarmonyDevice } } = this.dataProvider!.devicesByHub;
Object.keys(hubs).forEach((hubName: string) => {
const deviceDictionary = hubs[hubName];
this.log(`${hubName}`)
// TODO const hubs: { [hubName: string]: { [deviceName: string]: HarmonyDevice } } = this.dataProvider!.devicesByHub;
// Object.keys(hubs).forEach((hubName: string) => {
// const deviceDictionary = hubs[hubName];
// this.log(`${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}`);
// });
// });
// });
});
}