docs/interfaces/PlatformAccessory.html
Export Platform Accessory Types
interface PlatformAccessory<T extends UnknownContext = UnknownContext> {
_associatedHAPAccessory: Accessory;
_associatedPlatform?: string;
_associatedPlugin?: string;
category: Categories;
context: T;
displayName: string;
emit: (event: "identify") => boolean;
on: (event: "identify", listener: () => void) => this;
services: Service[];
UUID: string;
addService(service: Service): Service;
addService<S extends typeof Service>(
serviceConstructor: S,
...constructorArgs: ConstructorArgs<S>,
): Service;
configureController(
controller: Controller<ControllerServiceMap> | ControllerConstructor,
): void;
getService<T extends WithUUID<typeof Service>>(
name: string | T,
): Service | undefined;
getServiceById<T extends WithUUID<typeof Service>>(
uuid: string | T,
subType: string,
): Service | undefined;
removeController(controller: Controller): void;
removeService(service: Service): void;
updateDisplayName(name: string): void;
}
_associatedHAPAccessory_associatedPlatform?_associatedPlugin?categorycontextdisplayNameemitonservicesUUID
addServiceconfigureControllergetServicegetServiceByIdremoveControllerremoveServiceupdateDisplayName
_associatedHAPAccessory: Accessory
Optional_associatedPlatform_associatedPlatform?: string
Optional_associatedPlugin_associatedPlugin?: string
category: Categories
context: T = ...
This is a way for Plugin developers to store custom data with their accessory
displayName: string
emit: (event: "identify") => boolean
on: (event: "identify", listener: () => void) => this
services: Service[] = []
UUID: string
addService(service: Service): Service
addService<S extends typeof Service>(
serviceConstructor: S,
...constructorArgs: ConstructorArgs<S>,
): Service
configureController(
controller: Controller<ControllerServiceMap> | ControllerConstructor,
): void
Configures a new controller for the given accessory. See Accessory.configureController.
getService<T extends WithUUID<typeof Service>>(
name: string | T,
): Service | undefined
getServiceById<T extends WithUUID<typeof Service>>(
uuid: string | T,
subType: string,
): Service | undefined
removeController(controller: Controller): void
Removes a configured controller from the given accessory. See Accessory.removeController.
removeService(service: Service): void
updateDisplayName(name: string): void
Member Visibility
ThemeOSLightDark
Properties _associatedHAPAccessory_associatedPlatform_associatedPlugincategorycontextdisplayNameemitonservicesUUID Methods addServiceconfigureControllergetServicegetServiceByIdremoveControllerremoveServiceupdateDisplayName