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;
reachable: boolean;
services: Service[];
UUID: string;
addService(service: Service): Service;
addService<S extends typeof Service>(
serviceConstructor: S,
...constructorArgs: ConstructorArgs<S>,
): Service;
configureCameraSource(cameraSource: LegacyCameraSource): CameraController;
configureController(
controller: Controller<ControllerServiceMap> | ControllerConstructor,
): void;
emit(event: "identify"): boolean;
getService<T extends WithUUID<typeof Service>>(
name: string | T,
): Service | undefined;
getServiceById<T extends WithUUID<typeof Service>>(
uuid: string | T,
subType: string,
): Service | undefined;
getServiceByUUIDAndSubType<T extends WithUUID<typeof Service>>(
uuid: string | T,
subType: string,
): Service | undefined;
on(event: "identify", listener: () => void): this;
removeController(controller: Controller): void;
removeService(service: Service): void;
updateDisplayName(name: string): void;
updateReachability(reachable: boolean): void;
}
_associatedHAPAccessory_associatedPlatform?_associatedPlugin?categorycontextdisplayNamereachableservicesUUID
addServiceconfigureCameraSourceconfigureControlleremitgetServicegetServiceByIdgetServiceByUUIDAndSubTypeonremoveControllerremoveServiceupdateDisplayNameupdateReachability
_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
reachable: boolean = false
reachability has no effect and isn't supported anymore
services: Service[] = []
UUID: string
addService(service: Service): Service
addService<S extends typeof Service>(
serviceConstructor: S,
...constructorArgs: ConstructorArgs<S>,
): Service
configureCameraSource(cameraSource: LegacyCameraSource): CameraController
see Accessory.configureCameraSource
configureController(
controller: Controller<ControllerServiceMap> | ControllerConstructor,
): void
Configures a new controller for the given accessory. See Accessory.configureController.
emit(event: "identify"): boolean
getService<T extends WithUUID<typeof Service>>(
name: string | T,
): Service | undefined
getServiceById<T extends WithUUID<typeof Service>>(
uuid: string | T,
subType: string,
): Service | undefined
getServiceByUUIDAndSubType<T extends WithUUID<typeof Service>>(
uuid: string | T,
subType: string,
): Service | undefined
use getServiceById directly
on(event: "identify", listener: () => void): this
removeController(controller: Controller): void
Removes a configured controller from the given accessory. See Accessory.removeController.
removeService(service: Service): void
updateDisplayName(name: string): void
updateReachability(reachable: boolean): void
reachability has no effect and isn't supported anymore
Member Visibility
ThemeOSLightDark
Properties _associatedHAPAccessory_associatedPlatform_associatedPlugincategorycontextdisplayNamereachableservicesUUID Methods addServiceconfigureCameraSourceconfigureControlleremitgetServicegetServiceByIdgetServiceByUUIDAndSubTypeonremoveControllerremoveServiceupdateDisplayNameupdateReachability