import { AccessoryPlugin , API , HAP , Logging , PlatformConfig , StaticPlatformPlugin , } from "homebridge" ; import { ExampleSwitch } from "./switch-accessory" ; const PLATFORM_NAME = "ExampleStaticPlatform" ; let hap ; export = ( api ) => { hap = api . hap ; api . registerPlatform ( PLATFORM_NAME , ExampleStaticPlatform ) ; } ; class ExampleStaticPlatform implements StaticPlatformPlugin { private readonly log : Logging ; constructor ( log , config , api ) { this . log = log ; log . info ( "Example platform finished initializing!" ) ; } accessories ( callback ) { callback ( [ new ExampleSwitch ( hap , this . log , "Switch 1" ) , new ExampleSwitch ( hap , this . log , "Switch 2" ) , ] ) ; } }