homebridge-kasa-python
Version:
Plugin that uses Python-Kasa API to communicate with Kasa Devices.
87 lines (86 loc) • 2.02 kB
TypeScript
export type KasaDevice = LightBulb | Plug | PowerStrip | Switch;
export interface SysInfo {
alias: string;
brightness?: number;
children?: ChildDevice[];
child_num: number;
color_temp?: number;
device_id: string;
device_type: string;
fan_speed_level?: number;
host: string;
hw_ver: string;
hsv?: HSV;
mac: string;
model: string;
state?: boolean;
sw_ver: string;
[key: string]: string | number | boolean | ChildDevice[] | HSV | undefined;
}
export interface FeatureInfo {
brightness?: boolean;
color_temp?: boolean;
hsv?: boolean;
fan?: boolean;
}
export interface ChildDevice {
alias: string;
brightness?: number;
color_temp?: number;
fan_speed_level?: number;
hsv?: HSV;
id: string;
state: boolean;
[key: string]: string | number | boolean | HSV | undefined;
}
export interface HSV {
hue: number;
saturation: number;
}
export interface DeviceConfig {
host: string;
timeout: number;
credentials?: {
username: string;
password: string;
};
connection_type: {
device_family: string;
encryption_type: string;
https: boolean;
};
uses_http: boolean;
}
export interface ConfigDevice {
host: string;
alias: string;
}
export interface LightBulb {
sys_info: SysInfo;
feature_info: FeatureInfo;
last_seen: Date;
offline: boolean;
}
export interface Plug {
sys_info: SysInfo;
feature_info: FeatureInfo;
last_seen: Date;
offline: boolean;
}
export interface PowerStrip {
sys_info: SysInfo;
feature_info: FeatureInfo;
last_seen: Date;
offline: boolean;
}
export interface Switch {
sys_info: SysInfo;
feature_info: FeatureInfo;
last_seen: Date;
offline: boolean;
}
export declare const Plugs: string[];
export declare const PowerStrips: string[];
export declare const Switches: string[];
export declare const LightBulbs: string[];
export declare const Unsupported: string[];