-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshellies.d.ts
78 lines (70 loc) · 1.36 KB
/
shellies.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
declare module "shellies";
function on(type: "discover", listener: (device: Shelly) => void): void;
function start(networkInterface?: unknown): Promise<any>;
function stop(): void;
function setAuthCredentials(username: string, password: string): void;
const size: number;
const running: boolean;
[Symbol.iterator[Shelly]];
interface Shelly {
id: string;
type: string;
name: string;
host: string;
on(
type: "change",
listener: (prop: string, newValue: any, oldValue: any) => void
): void;
}
interface ShellyStatus {
wifi_sta: WifiStatus;
cloud: Cloud;
mqtt: Mqtt;
time: string;
unixtime: number;
serial: number;
has_update: boolean;
mac: string;
update: Update;
ram_total: number;
ram_free: number;
ram_lwm: number;
fs_size: number;
fs_free: number;
uptime: number;
}
interface Cloud {
enabled: boolean;
connected: boolean;
}
interface Mqtt {
connected: boolean;
}
interface Update {
status: string;
has_update: boolean;
new_version: string;
old_version: string;
}
interface WifiStatus {
connected: boolean;
ssid: string;
ip: string;
rssi: number;
}
interface ShellySettings {
build_info: {
build_id: string;
build_timestamp: string;
build_version: string;
};
name: string;
device: {
type: string;
mac: string;
hostname: string;
};
hwinfo?: {
hw_revision: string;
};
}