homebridge
    Preparing search index...

    Interface AccessoryPlugin

    Export types for basically everything but the actual API implementation

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

    Properties

    getControllers?: () => Controller<ControllerServiceMap>[]

    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.

    Type Declaration

      • (): Controller<ControllerServiceMap>[]
      • Returns Controller<ControllerServiceMap>[]

        controllers - returned controllers will be configured for the Accessory

    getServices: () => Service[]

    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.

    Type Declaration

      • (): Service[]
      • Returns Service[]

        services - returned services will be added to the Accessory

    identify?: () => void

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