homebridge-kef-speaker
Version:
Homebridge plugin for KEF wireless speakers (LS50 Wireless II, LSX II, LS60)
110 lines (109 loc) • 2.71 kB
TypeScript
import type { CharacteristicValue, PlatformAccessory } from 'homebridge';
import type { KefLsxIIPlatform } from './platform.js';
/**
* KEF Speaker Accessory
* Implements HomeKit Television Service for complete speaker control
*/
export declare class KefSpeakerAccessory {
private readonly platform;
private readonly accessory;
private service;
private speakerService;
private inputSources;
private connector;
private speakerConfig;
private currentStatus;
private nightModeActive;
private previousVolume;
private pollingInterval?;
private pollingActive;
constructor(platform: KefLsxIIPlatform, accessory: PlatformAccessory);
/**
* Setup input sources based on speaker model
*/
private setupInputSources;
/**
* Get HomeKit input source type for KEF source
*/
private getInputSourceType;
/**
* Setup event handlers
*/
private setupEventHandlers;
/**
* Initialize speaker state
*/
private initializeSpeaker;
/**
* Update HomeKit state with current speaker status
*/
private updateHomeKitState;
/**
* Update device name to show current playing song
*/
private updateDeviceNameWithSongInfo;
/**
* Start periodic status checking
*/
private startPeriodicCheck;
/**
* Stop periodic checking
*/
private stopPeriodicCheck;
/**
* Handle speaker changes from periodic checking
*/
private handleSpeakerChanges;
/**
* Get power state
*/
getActive(): Promise<CharacteristicValue>;
/**
* Set power state
*/
setActive(value: CharacteristicValue): Promise<void>;
/**
* Get active source
*/
getActiveIdentifier(): Promise<CharacteristicValue>;
/**
* Set active source
*/
setActiveIdentifier(value: CharacteristicValue): Promise<void>;
/**
* Handle remote key commands
*/
setRemoteKey(value: CharacteristicValue): Promise<void>;
/**
* Get volume
*/
getVolume(): Promise<CharacteristicValue>;
/**
* Set volume
*/
setVolume(value: CharacteristicValue): Promise<void>;
/**
* Get mute state
*/
getMute(): Promise<CharacteristicValue>;
/**
* Set mute state
*/
setMute(value: CharacteristicValue): Promise<void>;
/**
* Handle volume selector (remote volume up/down)
*/
setVolumeSelector(value: CharacteristicValue): Promise<void>;
/**
* Activate night mode
*/
activateNightMode(): void;
/**
* Deactivate night mode
*/
deactivateNightMode(): void;
/**
* Cleanup
*/
destroy(): void;
}