UNPKG

tsvesync

Version:

A TypeScript library for interacting with VeSync smart home devices

101 lines (100 loc) 2.93 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 bypassV2 purifiers that surface nested result codes. */ protected checkV2Response(response: any, status: number, method: string): boolean; /** * Get device details */ getDetails(): Promise<Boolean>; /** * Build purifier dictionary */ protected buildPurifierDict(devDict: Record<string, any>): void; /** * Determine whether this purifier requires the powerSwitch payload and nested response handling. */ private requiresPowerSwitchPayload; /** * Override turn on to use the powerSwitch payload required by bypassV2 purifiers. */ turnOn(): Promise<boolean>; /** * Override turn off to use the powerSwitch payload required by bypassV2 purifiers. */ turnOff(): Promise<boolean>; /** * Override setMode to send workMode payloads for bypassV2 purifiers. */ setMode(mode: string): Promise<boolean>; /** * Convenience helper to enter turbo mode when supported. */ turboMode(): Promise<boolean>; /** * Convenience helper to enter pet mode when supported. */ petMode(): Promise<boolean>; /** * Override changeFanSpeed to use manualSpeedLevel for bypassV2 purifiers. */ 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>; }