import type { AdaptiveLightingController, Characteristic, ColorUtils, HapStatusError, PlatformAccessory, Service } from 'homebridge'; import type { PhilipsTVClient } from '../api/PhilipsTVClient.js'; import type { AmbilightCached, AmbilightColor } from '../api/types.js'; export interface AmbilightServiceDeps { readonly Service: typeof Service; readonly Characteristic: typeof Characteristic; readonly AdaptiveLightingController: typeof AdaptiveLightingController; readonly ColorUtils: typeof ColorUtils; readonly tvClient: PhilipsTVClient; readonly accessory: PlatformAccessory; readonly ambilightMode?: string; readonly communicationError: () => HapStatusError; readonly log: (level: 'debug' | 'info' | 'warn' | 'error', message: string) => void; } export declare class AmbilightService { private readonly deps; private service; private isOn; private brightness; private hue; private saturation; private colorTemperature; private lastUserAction; private styleRetryTimer?; constructor(deps: AmbilightServiceDeps); get isAmbilightOn(): boolean; getService(): Service; configureService(accessory: PlatformAccessory, tvService: Service): Service; /** * Turn Ambilight on using the configured mode. Used to auto-start Ambilight * when the TV powers on (the `ambilightOnStart` option). */ startWithConfiguredMode(): Promise; /** * Reflect the TV powering off: Ambilight is off, so update the HomeKit * Lightbulb to Off without sending a command to the (now unreachable) TV. */ reflectPowerOff(): void; private parseAmbilightMode; private handleSetOn; private handleSetBrightness; private handleSetHue; private handleSetSaturation; private handleSetColorTemperature; /** * TV restores its own default ambilight mode asynchronously after power ON. * Re-send the desired style after delays to override it. */ private cancelStyleRetry; private scheduleStyleRetry; updateFromPoll(ambilightStyle: AmbilightCached | null, ambilightPowerFallback: boolean): void; /** * Convert HomeKit HSB values to Philips Ambilight color format * HomeKit: Hue 0-360, Saturation 0-100, Brightness 0-100 * Philips: Hue 0-255, Saturation 0-255, Brightness 0-255 */ homekitToPhilipsColor(hue: number, saturation: number, brightness: number): AmbilightColor; /** * Convert Philips Ambilight color format to HomeKit HSB values * Philips: Hue 0-255, Saturation 0-255, Brightness 0-255 * HomeKit: Hue 0-360, Saturation 0-100, Brightness 0-100 */ philipsToHomekitColor(color: AmbilightColor): { hue: number; saturation: number; brightness: number; }; }