UNPKG

@ronniepettersson/homebridge-dummy

Version:

Create Homebridge accessories to help with automation and control — scheduling, delays, sensors, commands, webhooks, and more

37 lines (36 loc) 1.7 kB
import { PlatformAccessory, Service } from 'homebridge'; import { SensorAccessory } from './sensor.js'; import { AccessoryType } from '../model/enums.js'; import { CharacteristicType, DummyConfig, ServiceType } from '../model/types.js'; import { Webhook } from '../model/webhook.js'; import { Log } from '../tools/log.js'; export declare abstract class DummyAccessory<C extends DummyConfig> { protected readonly Service: ServiceType; protected readonly Characteristic: CharacteristicType; protected readonly accessory: PlatformAccessory; protected readonly config: C; protected readonly log: Log; protected sensor?: SensorAccessory; static identifier(config: DummyConfig): string; protected readonly accessoryService: Service; private readonly _schedule?; private readonly _timer?; private readonly _limiter?; private readonly execAsync; constructor(Service: ServiceType, Characteristic: CharacteristicType, accessory: PlatformAccessory, config: C, log: Log, isGrouped: boolean); protected abstract getAccessoryType(): AccessoryType; protected abstract schedule(): Promise<void>; protected abstract reset(): Promise<void>; get subtype(): string | undefined; teardown(): void; abstract webhooks(): Webhook[]; protected get identifier(): string; protected get name(): string; protected get isStateful(): boolean; protected get defaultStateStorageKey(): string; protected startTimer(): void; protected cancelTimer(): void; protected executeCommand(command: string): Promise<void>; private isExecException; protected logIfDesired(message: string, ...parameters: (string | number)[]): void; }