UNPKG

tsvesync

Version:

A TypeScript library for interacting with VeSync smart home devices

95 lines (94 loc) 2.72 kB
import { VeSyncAirBypass } from './airBypass'; import { VeSync } from '../vesync'; /** * VeSync Air Purifier with Bypass V2 */ export declare class VeSyncAirBaseV2 extends VeSyncAirBypass { protected _lightDetection: boolean; protected _lightDetectionState: boolean; protected setSpeedLevel: number | null; protected autoPreferences: string[]; protected enabled: boolean; protected _mode: string; protected _speed: number; protected _timer: { duration: number; action: string; } | null; constructor(details: Record<string, any>, manager: VeSync); protected buildConfigDict(configDict: Record<string, any>): void; get mode(): string; set mode(value: string); get speed(): number; set speed(value: number); get timer(): { duration: number; action: string; } | null; set timer(value: { duration: number; action: string; } | null); /** * Check response for Vital series devices * These devices return success at API level but may have inner errors */ protected checkVitalResponse(response: any, status: number, method: string): boolean; /** * Get device details */ getDetails(): Promise<Boolean>; /** * Build purifier dictionary */ protected buildPurifierDict(devDict: Record<string, any>): void; /** * Check if the current device is a Vital series model * @returns true if this is a LAP-V102S or LAP-V201S device */ private isVitalSeries; /** * Override turn on method to handle Vital series special cases */ turnOn(): Promise<boolean>; /** * Override turn off method to handle Vital series special cases */ turnOff(): Promise<boolean>; /** * Override setMode method to handle Vital series special cases */ setMode(mode: string): Promise<boolean>; /** * Override changeFanSpeed method to handle Vital series special cases */ changeFanSpeed(speed: number): Promise<boolean>; /** * Set auto preference */ setAutoPreference(preference?: string, roomSize?: number): Promise<boolean>; /** * Set light detection */ setLightDetection(enabled: boolean): Promise<boolean>; /** * Get light detection status */ get lightDetection(): boolean; /** * Get light detection state */ get lightDetectionState(): boolean; /** * Get auto preference type */ get autoPreferenceType(): string | null; /** * Display JSON details */ displayJSON(): string; /** * Set oscillation state */ setOscillation(toggle: boolean): Promise<boolean>; }