tsvesync
Version:
A TypeScript library for interacting with VeSync smart home devices
49 lines (48 loc) • 1.16 kB
TypeScript
/**
* VeSync Switch Classes
*/
import { VeSyncBaseDevice } from './vesyncBaseDevice';
import { VeSync } from './vesync';
interface SwitchConfig {
[key: string]: {
module: string;
features: string[];
};
}
export declare const switchConfig: SwitchConfig;
/**
* Base class for VeSync Switches
*/
export declare abstract class VeSyncSwitch extends VeSyncBaseDevice {
protected details: Record<string, any>;
protected features: string[];
constructor(details: Record<string, any>, manager: VeSync);
/**
* Get active time of switch
*/
get activeTime(): number;
/**
* Return true if switch is dimmable
*/
isDimmable(): boolean;
/**
* Return formatted device info to stdout
*/
display(): void;
/**
* Return JSON details for switch
*/
displayJSON(): string;
/**
* Get switch details
*/
abstract getDetails(): Promise<Boolean>;
/**
* Update switch details
*/
update(): Promise<Boolean>;
abstract getConfig(): Promise<void>;
abstract turnOn(): Promise<boolean>;
abstract turnOff(): Promise<boolean>;
}
export {};