homebridge-aplvibe
Version:
Homebridge plugin for SleepMe devices using APL as core logic engine
47 lines • 1.75 kB
TypeScript
import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, Service, Characteristic } from 'homebridge';
import { APLVibeConfig } from './types';
export declare class APLVibePlatform implements DynamicPlatformPlugin {
readonly log: Logger;
readonly config: APLVibeConfig;
readonly api: API;
readonly Service: typeof Service;
readonly Characteristic: typeof Characteristic;
readonly accessories: PlatformAccessory[];
private aplEngine;
private pollingInterval?;
constructor(log: Logger, config: APLVibeConfig, api: API);
/**
* Initialize platform by delegating to APL engine
* This demonstrates the delegation pattern - TypeScript handles Homebridge integration,
* APL handles all business logic
*/
private initializePlatform;
/**
* Device discovery delegates to APL engine
* APL handles device management logic, TypeScript handles Homebridge accessory creation
*/
private discoverDevices;
/**
* Add accessory - minimal Homebridge setup, delegates state management to APL
*/
private addAccessory;
/**
* Setup accessory services - creates Homebridge services but delegates all logic to APL
*/
private setupAccessoryServices;
/**
* Handle state changes from APL engine
* APL emits events when state changes, TypeScript translates to Homebridge
*/
private handleStateChange;
/**
* Start polling for device updates - delegates to APL for scheduling and rate limiting
*/
private startPolling;
configureAccessory(accessory: PlatformAccessory): void;
/**
* Cleanup - destroy APL engine and clear intervals
*/
destroy(): void;
}
//# sourceMappingURL=platform.d.ts.map