UNPKG

tsvesync

Version:

A TypeScript library for interacting with VeSync smart home devices

89 lines (88 loc) 1.96 kB
/** * VeSync Bulb Base Class */ import { VeSyncBaseDevice } from './vesyncBaseDevice'; import { VeSync } from './vesync'; interface BulbConfig { [key: string]: { module: string; features: string[]; colorModel: string; }; } export declare const bulbConfig: BulbConfig; /** * VeSync Bulb Base Class */ export declare abstract class VeSyncBulb extends VeSyncBaseDevice { protected brightness: number; protected colorTemp: number; protected colorValue: number; protected colorHue: number; protected colorSaturation: number; protected colorMode: string; protected features: string[]; protected rgbValues: { red: number; green: number; blue: number; }; constructor(details: Record<string, any>, manager: VeSync); /** * Get bulb details */ getDetails(): Promise<Boolean>; /** * Update bulb details */ update(): Promise<Boolean>; /** * Turn bulb on */ turnOn(): Promise<boolean>; /** * Turn bulb off */ turnOff(): Promise<boolean>; /** * Set bulb brightness */ setBrightness(brightness: number): Promise<boolean>; /** * Get bulb brightness */ getBrightness(): number; /** * Get color temperature in Kelvin */ getColorTempKelvin(): number; /** * Get color temperature in percent */ getColorTempPercent(): number; /** * Get color hue */ getColorHue(): number; /** * Get color saturation */ getColorSaturation(): number; /** * Get color value */ getColorValue(): number; /** * Get RGB values */ getRGBValues(): { red: number; green: number; blue: number; }; /** * Set color temperature - Abstract method to be implemented by subclasses */ abstract setColorTemp(colorTemp: number): Promise<boolean>; } export {};