Interface AccessoryPlugin

interface AccessoryPlugin {
    getControllers?(): Controller<ControllerServiceMap>[];
    getServices(): Service[];
    identify?(): void;
}

Methods

  • This method will be called once on startup, to query all controllers to be exposed by the Accessory. It is optional to implement.

    This includes controllers like the RemoteController or the CameraController. Any necessary controller specific setup should have been done when returning the array. In most cases the plugin will only return an array of the size 1.

    In the case that the Plugin does not add any additional services (returned by getServices) the method getServices must be defined in any way and should just return an empty array.

    Returns Controller<ControllerServiceMap>[]

    controllers - returned controllers will be configured for the Accessory

  • This method will be called once on startup, to query all services to be exposed by the Accessory. All event handlers for characteristics should be set up before the array is returned.

    Returns Service[]

    services - returned services will be added to the Accessory

  • Optional method which will be called if a 'identify' of an Accessory is requested by HomeKit.

    Returns void