Back to Homebridge

Interface AccessoryPlugin

docs/interfaces/AccessoryPlugin.html

1.11.41.8 KB
Original Source
  • AccessoryPlugin

Interface AccessoryPlugin

Export types for basically everything but the actual API implementation

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

Index

Methods

getControllers?getServicesidentify?

Methods

OptionalgetControllers

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.

Returns Controller<ControllerServiceMap>[]

controllers - returned controllers will be configured for the Accessory

getServices

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.

Returns Service[]

services - returned services will be added to the Accessory

Optionalidentify

identify?(): void

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

Returns void

Settings

Member Visibility

  • Inherited

ThemeOSLightDark

On This Page

Methods getControllersgetServicesidentify