homebridge
    Preparing search index...

    Interface PlatformAccessory<T>

    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,
        ): undefined | Service;
        getServiceById<T extends WithUUID<typeof Service>>(
            uuid: string | T,
            subType: string,
        ): undefined | Service;
        getServiceByUUIDAndSubType<T extends WithUUID<typeof Service>>(
            uuid: string | T,
            subType: string,
        ): undefined | Service;
        on(event: "identify", listener: () => void): this;
        removeController(controller: Controller): void;
        removeService(service: Service): void;
        updateDisplayName(name: string): void;
        updateReachability(reachable: boolean): void;
    }

    Type Parameters

    Hierarchy

    • EventEmitter
      • PlatformAccessory
    Index

    Properties

    _associatedHAPAccessory: Accessory
    _associatedPlatform?: string
    _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

    Methods

    • Parameters

      • service: Service

      Returns Service

    • Type Parameters

      • S extends typeof Service

      Parameters

      • serviceConstructor: S
      • ...constructorArgs: ConstructorArgs<S>

      Returns Service

    • Configures a new controller for the given accessory. See Accessory.configureController.

      Parameters

      • controller: Controller<ControllerServiceMap> | ControllerConstructor

      Returns void

    • Type Parameters

      • T extends WithUUID<typeof Service>

      Parameters

      • name: string | T

      Returns undefined | Service

    • Type Parameters

      • T extends WithUUID<typeof Service>

      Parameters

      • uuid: string | T
      • subType: string

      Returns undefined | Service

    • Type Parameters

      • T extends WithUUID<typeof Service>

      Parameters

      • uuid: string | T
      • subType: string

      Returns undefined | Service

      use getServiceById directly

    • Parameters

      • event: "identify"
      • listener: () => void

      Returns this

    • Parameters

      • reachable: boolean

      Returns void

      reachability has no effect and isn't supported anymore