@homebridge-plugins/homebridge-august
Version:
The August plugin allows you to access your August & Yale device(s) from HomeKit.
21 lines • 1.04 kB
JavaScript
import { AugustPlatform } from './Platform.HAP.js';
import { AugustMatterPlatform } from './platform.matter.js';
import { PLATFORM_NAME, PLUGIN_NAME } from './settings.js';
// Register our platform with homebridge.
// Create a proxy constructor that selects the appropriate platform implementation
function createAugustPlatformProxy(api) {
return function AugustPlatformProxy(log, config, apiInner) {
const disableMatter = config?.options?.disableMatter;
if (api.isMatterAvailable?.() && api.isMatterEnabled?.() && !disableMatter) {
return new AugustMatterPlatform(log, config, apiInner);
}
return new AugustPlatform(log, config, apiInner);
};
}
// Register our platform proxy with homebridge.
export default (api) => {
// Type cast to any because we return a dynamic constructor that delegates
// to either `AugustPlatform` or `AugustMatterPlatform` at runtime.
api.registerPlatform(PLUGIN_NAME, PLATFORM_NAME, createAugustPlatformProxy(api));
};
//# sourceMappingURL=index.js.map