UNPKG

homebridge-poolcontroller-clocklear

Version:

A (semi) private Homebridge plugin for my custom Pool Controller app

37 lines (35 loc) 1.64 kB
import { PlatformAccessory, CharacteristicValue } from 'homebridge'; import { PoolControllerHomebridgePlatform } from './platform.js'; import { RelayState } from './poolControllerClient.js'; /** * Platform Accessory * An instance of this class is created for each accessory your platform registers * Each accessory may expose multiple services of different service types. */ export declare class RelayAccessory { private readonly platform; private readonly accessory; private readonly relayId; private readonly asyncUpdates; private service; private state; constructor(platform: PoolControllerHomebridgePlatform, accessory: PlatformAccessory, relayId: number, asyncUpdates: boolean, initialState: RelayState); /** * Handle "SET" requests from HomeKit * These are sent when the user changes the state of an accessory, for example, turning on a Light bulb. */ setOn(value: CharacteristicValue): Promise<void>; /** * Handle the "GET" requests from HomeKit * These are sent when HomeKit wants to know the current state of the accessory, for example, checking if a Light bulb is on. * * GET requests should return as fast as possible. A long delay here will result in * HomeKit being unresponsive and a bad user experience in general. * * If your device takes time to respond you should update the status of your device * asynchronously instead using the `updateCharacteristic` method instead. * @example * this.service.updateCharacteristic(this.platform.Characteristic.On, true) */ getOn(): Promise<CharacteristicValue>; }