tsvesync 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/vesyncOutlet.js +21 -2
- package/package.json +1 -1
- package/src/lib/vesyncOutlet.ts +21 -3
- package/dist/lib/helpers.js.map +0 -1
- package/dist/lib/vesync.js.map +0 -1
- package/dist/lib/vesyncBaseDevice.js.map +0 -1
- package/dist/lib/vesyncBulb.js.map +0 -1
- package/dist/lib/vesyncFan.js.map +0 -1
- package/dist/lib/vesyncKitchen.d.ts +0 -0
- package/dist/lib/vesyncKitchen.js +0 -2
- package/dist/lib/vesyncKitchen.js.map +0 -1
- package/dist/lib/vesyncOutlet.js.map +0 -1
- package/dist/lib/vesyncSwitch.js.map +0 -1
- package/dist/src/lib/helpers.d.ts +0 -88
- package/dist/src/lib/helpers.js +0 -244
- package/dist/src/lib/vesync.d.ts +0 -89
- package/dist/src/lib/vesync.js +0 -430
- package/dist/src/lib/vesyncBaseDevice.d.ts +0 -43
- package/dist/src/lib/vesyncBaseDevice.js +0 -87
- package/dist/src/lib/vesyncBulb.d.ts +0 -79
- package/dist/src/lib/vesyncBulb.js +0 -198
- package/dist/src/lib/vesyncBulbImpl.d.ts +0 -38
- package/dist/src/lib/vesyncBulbImpl.js +0 -161
- package/dist/src/lib/vesyncFan.d.ts +0 -80
- package/dist/src/lib/vesyncFan.js +0 -406
- package/dist/src/lib/vesyncFanImpl.d.ts +0 -137
- package/dist/src/lib/vesyncFanImpl.js +0 -643
- package/dist/src/lib/vesyncOutlet.d.ts +0 -53
- package/dist/src/lib/vesyncOutlet.js +0 -98
- package/dist/src/lib/vesyncOutletImpl.d.ts +0 -70
- package/dist/src/lib/vesyncOutletImpl.js +0 -206
- package/dist/src/lib/vesyncSwitch.d.ts +0 -169
- package/dist/src/lib/vesyncSwitch.js +0 -414
- package/dist/src/lib/vesyncSwitchImpl.d.ts +0 -82
- package/dist/src/lib/vesyncSwitchImpl.js +0 -290
- package/dist/test/testFeatures.d.ts +0 -4
- package/dist/test/testFeatures.js +0 -394
- package/dist/test/testService.d.ts +0 -62
- package/dist/test/testService.js +0 -540
- package/dist/test/testSpecial.d.ts +0 -5
- package/dist/test/testSpecial.js +0 -227
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* VeSync Outlets
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.VeSyncOutlet = void 0;
|
|
7
|
-
const vesyncBaseDevice_1 = require("./vesyncBaseDevice");
|
|
8
|
-
const helpers_1 = require("./helpers");
|
|
9
|
-
/**
|
|
10
|
-
* VeSync Outlet Base Class
|
|
11
|
-
*/
|
|
12
|
-
class VeSyncOutlet extends vesyncBaseDevice_1.VeSyncBaseDevice {
|
|
13
|
-
constructor(details, manager) {
|
|
14
|
-
super(details, manager);
|
|
15
|
-
this.energy = {};
|
|
16
|
-
this.details = details;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Get outlet details
|
|
20
|
-
*/
|
|
21
|
-
async getDetails() {
|
|
22
|
-
const url = `/v1/${this.deviceType}/${this.deviceType}-${this.cid}/detail`;
|
|
23
|
-
const [response] = await helpers_1.Helpers.callApi(url, 'get', null, helpers_1.Helpers.reqHeaders(this.manager));
|
|
24
|
-
if (response?.code === 0) {
|
|
25
|
-
this.details = response.result;
|
|
26
|
-
this.deviceStatus = response.result.deviceStatus;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Update outlet energy data
|
|
31
|
-
*/
|
|
32
|
-
async updateEnergy() {
|
|
33
|
-
const url = `/v1/${this.deviceType}/${this.deviceType}-${this.cid}/energy/detail`;
|
|
34
|
-
const [response] = await helpers_1.Helpers.callApi(url, 'get', null, helpers_1.Helpers.reqHeaders(this.manager));
|
|
35
|
-
if (response?.code === 0) {
|
|
36
|
-
this.energy = response.result;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Get outlet energy usage
|
|
41
|
-
*/
|
|
42
|
-
async getEnergyUsage() {
|
|
43
|
-
await this.updateEnergy();
|
|
44
|
-
return {
|
|
45
|
-
power: this.energy.power || 'Not available',
|
|
46
|
-
voltage: this.energy.voltage || 'Not available',
|
|
47
|
-
energy_today: this.energy.energyToday || 'Not available',
|
|
48
|
-
energy_week: this.energy.energyWeek || 'Not available',
|
|
49
|
-
energy_month: this.energy.energyMonth || 'Not available',
|
|
50
|
-
energy_year: this.energy.energyYear || 'Not available'
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Get outlet status
|
|
55
|
-
*/
|
|
56
|
-
async getStatus() {
|
|
57
|
-
await this.getDetails();
|
|
58
|
-
return this.deviceStatus;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Get weekly energy data
|
|
62
|
-
*/
|
|
63
|
-
async getWeeklyEnergy() {
|
|
64
|
-
const url = `/v1/${this.deviceType}/${this.deviceType}-${this.cid}/energy/week`;
|
|
65
|
-
const [response] = await helpers_1.Helpers.callApi(url, 'get', null, helpers_1.Helpers.reqHeaders(this.manager));
|
|
66
|
-
if (response?.code === 0) {
|
|
67
|
-
this.energy.week = response.result;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Get monthly energy data
|
|
72
|
-
*/
|
|
73
|
-
async getMonthlyEnergy() {
|
|
74
|
-
const url = `/v1/${this.deviceType}/${this.deviceType}-${this.cid}/energy/month`;
|
|
75
|
-
const [response] = await helpers_1.Helpers.callApi(url, 'get', null, helpers_1.Helpers.reqHeaders(this.manager));
|
|
76
|
-
if (response?.code === 0) {
|
|
77
|
-
this.energy.month = response.result;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Get yearly energy data
|
|
82
|
-
*/
|
|
83
|
-
async getYearlyEnergy() {
|
|
84
|
-
const url = `/v1/${this.deviceType}/${this.deviceType}-${this.cid}/energy/year`;
|
|
85
|
-
const [response] = await helpers_1.Helpers.callApi(url, 'get', null, helpers_1.Helpers.reqHeaders(this.manager));
|
|
86
|
-
if (response?.code === 0) {
|
|
87
|
-
this.energy.year = response.result;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Update outlet details and energy info
|
|
92
|
-
*/
|
|
93
|
-
async update() {
|
|
94
|
-
await this.getDetails();
|
|
95
|
-
await this.updateEnergy();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
exports.VeSyncOutlet = VeSyncOutlet;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* VeSync Outlet Implementations
|
|
3
|
-
*/
|
|
4
|
-
import { VeSyncOutlet } from './vesyncOutlet';
|
|
5
|
-
import { VeSync } from './vesync';
|
|
6
|
-
/**
|
|
7
|
-
* VeSync 7A Outlet
|
|
8
|
-
*/
|
|
9
|
-
export declare class VeSyncOutlet7A extends VeSyncOutlet {
|
|
10
|
-
constructor(details: Record<string, any>, manager: VeSync);
|
|
11
|
-
/**
|
|
12
|
-
* Turn outlet on
|
|
13
|
-
*/
|
|
14
|
-
turnOn(): Promise<boolean>;
|
|
15
|
-
/**
|
|
16
|
-
* Turn outlet off
|
|
17
|
-
*/
|
|
18
|
-
turnOff(): Promise<boolean>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* VeSync 10A Outlet
|
|
22
|
-
*/
|
|
23
|
-
export declare class VeSyncOutlet10A extends VeSyncOutlet {
|
|
24
|
-
constructor(details: Record<string, any>, manager: VeSync);
|
|
25
|
-
/**
|
|
26
|
-
* Turn outlet on
|
|
27
|
-
*/
|
|
28
|
-
turnOn(): Promise<boolean>;
|
|
29
|
-
/**
|
|
30
|
-
* Turn outlet off
|
|
31
|
-
*/
|
|
32
|
-
turnOff(): Promise<boolean>;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* VeSync 15A Outlet
|
|
36
|
-
*/
|
|
37
|
-
export declare class VeSyncOutlet15A extends VeSyncOutlet {
|
|
38
|
-
constructor(details: Record<string, any>, manager: VeSync);
|
|
39
|
-
/**
|
|
40
|
-
* Turn outlet on
|
|
41
|
-
*/
|
|
42
|
-
turnOn(): Promise<boolean>;
|
|
43
|
-
/**
|
|
44
|
-
* Turn outlet off
|
|
45
|
-
*/
|
|
46
|
-
turnOff(): Promise<boolean>;
|
|
47
|
-
/**
|
|
48
|
-
* Turn on nightlight
|
|
49
|
-
*/
|
|
50
|
-
turnOnNightlight(): Promise<boolean>;
|
|
51
|
-
/**
|
|
52
|
-
* Turn off nightlight
|
|
53
|
-
*/
|
|
54
|
-
turnOffNightlight(): Promise<boolean>;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* VeSync Outdoor Plug
|
|
58
|
-
*/
|
|
59
|
-
export declare class VeSyncOutdoorPlug extends VeSyncOutlet {
|
|
60
|
-
constructor(details: Record<string, any>, manager: VeSync);
|
|
61
|
-
/**
|
|
62
|
-
* Turn outlet on
|
|
63
|
-
*/
|
|
64
|
-
turnOn(): Promise<boolean>;
|
|
65
|
-
/**
|
|
66
|
-
* Turn outlet off
|
|
67
|
-
*/
|
|
68
|
-
turnOff(): Promise<boolean>;
|
|
69
|
-
}
|
|
70
|
-
export declare const outletModules: Record<string, new (details: Record<string, any>, manager: VeSync) => VeSyncOutlet>;
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* VeSync Outlet Implementations
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.outletModules = exports.VeSyncOutdoorPlug = exports.VeSyncOutlet15A = exports.VeSyncOutlet10A = exports.VeSyncOutlet7A = void 0;
|
|
7
|
-
const vesyncOutlet_1 = require("./vesyncOutlet");
|
|
8
|
-
const helpers_1 = require("./helpers");
|
|
9
|
-
/**
|
|
10
|
-
* VeSync 7A Outlet
|
|
11
|
-
*/
|
|
12
|
-
class VeSyncOutlet7A extends vesyncOutlet_1.VeSyncOutlet {
|
|
13
|
-
constructor(details, manager) {
|
|
14
|
-
super(details, manager);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Turn outlet on
|
|
18
|
-
*/
|
|
19
|
-
async turnOn() {
|
|
20
|
-
const url = `/v1/wifi-switch-1.3/wifi-switch-1.3-${this.cid}/status/on`;
|
|
21
|
-
const [response] = await helpers_1.Helpers.callApi(url, 'put', null, helpers_1.Helpers.reqHeaders(this.manager));
|
|
22
|
-
if (response?.code === 0) {
|
|
23
|
-
this.deviceStatus = 'on';
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Turn outlet off
|
|
30
|
-
*/
|
|
31
|
-
async turnOff() {
|
|
32
|
-
const url = `/v1/wifi-switch-1.3/wifi-switch-1.3-${this.cid}/status/off`;
|
|
33
|
-
const [response] = await helpers_1.Helpers.callApi(url, 'put', null, helpers_1.Helpers.reqHeaders(this.manager));
|
|
34
|
-
if (response?.code === 0) {
|
|
35
|
-
this.deviceStatus = 'off';
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.VeSyncOutlet7A = VeSyncOutlet7A;
|
|
42
|
-
/**
|
|
43
|
-
* VeSync 10A Outlet
|
|
44
|
-
*/
|
|
45
|
-
class VeSyncOutlet10A extends vesyncOutlet_1.VeSyncOutlet {
|
|
46
|
-
constructor(details, manager) {
|
|
47
|
-
super(details, manager);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Turn outlet on
|
|
51
|
-
*/
|
|
52
|
-
async turnOn() {
|
|
53
|
-
const body = {
|
|
54
|
-
...helpers_1.Helpers.reqBody(this.manager, 'devicestatus'),
|
|
55
|
-
uuid: this.uuid,
|
|
56
|
-
status: 'on'
|
|
57
|
-
};
|
|
58
|
-
const [response] = await helpers_1.Helpers.callApi('/10a/v1/device/devicestatus', 'put', body, helpers_1.Helpers.reqHeaders(this.manager));
|
|
59
|
-
if (response?.code === 0) {
|
|
60
|
-
this.deviceStatus = 'on';
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Turn outlet off
|
|
67
|
-
*/
|
|
68
|
-
async turnOff() {
|
|
69
|
-
const body = {
|
|
70
|
-
...helpers_1.Helpers.reqBody(this.manager, 'devicestatus'),
|
|
71
|
-
uuid: this.uuid,
|
|
72
|
-
status: 'off'
|
|
73
|
-
};
|
|
74
|
-
const [response] = await helpers_1.Helpers.callApi('/10a/v1/device/devicestatus', 'put', body, helpers_1.Helpers.reqHeaders(this.manager));
|
|
75
|
-
if (response?.code === 0) {
|
|
76
|
-
this.deviceStatus = 'off';
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.VeSyncOutlet10A = VeSyncOutlet10A;
|
|
83
|
-
/**
|
|
84
|
-
* VeSync 15A Outlet
|
|
85
|
-
*/
|
|
86
|
-
class VeSyncOutlet15A extends vesyncOutlet_1.VeSyncOutlet {
|
|
87
|
-
constructor(details, manager) {
|
|
88
|
-
super(details, manager);
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Turn outlet on
|
|
92
|
-
*/
|
|
93
|
-
async turnOn() {
|
|
94
|
-
const body = {
|
|
95
|
-
...helpers_1.Helpers.reqBody(this.manager, 'devicestatus'),
|
|
96
|
-
uuid: this.uuid,
|
|
97
|
-
status: 'on'
|
|
98
|
-
};
|
|
99
|
-
const [response] = await helpers_1.Helpers.callApi('/15a/v1/device/devicestatus', 'put', body, helpers_1.Helpers.reqHeaders(this.manager));
|
|
100
|
-
if (response?.code === 0) {
|
|
101
|
-
this.deviceStatus = 'on';
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Turn outlet off
|
|
108
|
-
*/
|
|
109
|
-
async turnOff() {
|
|
110
|
-
const body = {
|
|
111
|
-
...helpers_1.Helpers.reqBody(this.manager, 'devicestatus'),
|
|
112
|
-
uuid: this.uuid,
|
|
113
|
-
status: 'off'
|
|
114
|
-
};
|
|
115
|
-
const [response] = await helpers_1.Helpers.callApi('/15a/v1/device/devicestatus', 'put', body, helpers_1.Helpers.reqHeaders(this.manager));
|
|
116
|
-
if (response?.code === 0) {
|
|
117
|
-
this.deviceStatus = 'off';
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Turn on nightlight
|
|
124
|
-
*/
|
|
125
|
-
async turnOnNightlight() {
|
|
126
|
-
const body = {
|
|
127
|
-
...helpers_1.Helpers.reqBody(this.manager, 'devicestatus'),
|
|
128
|
-
uuid: this.uuid,
|
|
129
|
-
mode: 'auto'
|
|
130
|
-
};
|
|
131
|
-
const [response] = await helpers_1.Helpers.callApi('/15a/v1/device/nightlightstatus', 'put', body, helpers_1.Helpers.reqHeaders(this.manager));
|
|
132
|
-
if (response?.code === 0) {
|
|
133
|
-
this.details.nightLightStatus = 'on';
|
|
134
|
-
return true;
|
|
135
|
-
}
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Turn off nightlight
|
|
140
|
-
*/
|
|
141
|
-
async turnOffNightlight() {
|
|
142
|
-
const body = {
|
|
143
|
-
...helpers_1.Helpers.reqBody(this.manager, 'devicestatus'),
|
|
144
|
-
uuid: this.uuid,
|
|
145
|
-
mode: 'manual'
|
|
146
|
-
};
|
|
147
|
-
const [response] = await helpers_1.Helpers.callApi('/15a/v1/device/nightlightstatus', 'put', body, helpers_1.Helpers.reqHeaders(this.manager));
|
|
148
|
-
if (response?.code === 0) {
|
|
149
|
-
this.details.nightLightStatus = 'off';
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
return false;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
exports.VeSyncOutlet15A = VeSyncOutlet15A;
|
|
156
|
-
/**
|
|
157
|
-
* VeSync Outdoor Plug
|
|
158
|
-
*/
|
|
159
|
-
class VeSyncOutdoorPlug extends vesyncOutlet_1.VeSyncOutlet {
|
|
160
|
-
constructor(details, manager) {
|
|
161
|
-
super(details, manager);
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Turn outlet on
|
|
165
|
-
*/
|
|
166
|
-
async turnOn() {
|
|
167
|
-
const body = {
|
|
168
|
-
...helpers_1.Helpers.reqBody(this.manager, 'devicestatus'),
|
|
169
|
-
uuid: this.uuid,
|
|
170
|
-
status: 'on',
|
|
171
|
-
switchNo: 1
|
|
172
|
-
};
|
|
173
|
-
const [response] = await helpers_1.Helpers.callApi('/outdoorsocket15a/v1/device/devicestatus', 'put', body, helpers_1.Helpers.reqHeaders(this.manager));
|
|
174
|
-
if (response?.code === 0) {
|
|
175
|
-
this.deviceStatus = 'on';
|
|
176
|
-
return true;
|
|
177
|
-
}
|
|
178
|
-
return false;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Turn outlet off
|
|
182
|
-
*/
|
|
183
|
-
async turnOff() {
|
|
184
|
-
const body = {
|
|
185
|
-
...helpers_1.Helpers.reqBody(this.manager, 'devicestatus'),
|
|
186
|
-
uuid: this.uuid,
|
|
187
|
-
status: 'off',
|
|
188
|
-
switchNo: 1
|
|
189
|
-
};
|
|
190
|
-
const [response] = await helpers_1.Helpers.callApi('/outdoorsocket15a/v1/device/devicestatus', 'put', body, helpers_1.Helpers.reqHeaders(this.manager));
|
|
191
|
-
if (response?.code === 0) {
|
|
192
|
-
this.deviceStatus = 'off';
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
return false;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
exports.VeSyncOutdoorPlug = VeSyncOutdoorPlug;
|
|
199
|
-
// Export outlet modules dictionary
|
|
200
|
-
exports.outletModules = {
|
|
201
|
-
'wifi-switch-1.3': VeSyncOutlet7A,
|
|
202
|
-
'ESW03-USA': VeSyncOutlet10A,
|
|
203
|
-
'ESW01-EU': VeSyncOutlet10A,
|
|
204
|
-
'ESW15-USA': VeSyncOutlet15A,
|
|
205
|
-
'ESO15-TB': VeSyncOutdoorPlug
|
|
206
|
-
};
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* VeSync Switch Classes
|
|
3
|
-
*/
|
|
4
|
-
import { VeSyncBaseDevice } from './vesyncBaseDevice';
|
|
5
|
-
import { VeSync } from './vesync';
|
|
6
|
-
type DeviceConstructor = new (config: Record<string, any>, manager: VeSync) => VeSyncBaseDevice;
|
|
7
|
-
interface SwitchConfig {
|
|
8
|
-
[key: string]: {
|
|
9
|
-
module: string;
|
|
10
|
-
features: string[];
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export declare const switchConfig: SwitchConfig;
|
|
14
|
-
/**
|
|
15
|
-
* Base class for VeSync Switches
|
|
16
|
-
*/
|
|
17
|
-
export declare abstract class VeSyncSwitch extends VeSyncBaseDevice {
|
|
18
|
-
protected details: Record<string, any>;
|
|
19
|
-
protected features: string[];
|
|
20
|
-
constructor(details: Record<string, any>, manager: VeSync);
|
|
21
|
-
/**
|
|
22
|
-
* Get active time of switch
|
|
23
|
-
*/
|
|
24
|
-
get activeTime(): number;
|
|
25
|
-
/**
|
|
26
|
-
* Return true if switch is dimmable
|
|
27
|
-
*/
|
|
28
|
-
isDimmable(): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Return formatted device info to stdout
|
|
31
|
-
*/
|
|
32
|
-
display(): void;
|
|
33
|
-
/**
|
|
34
|
-
* Return JSON details for switch
|
|
35
|
-
*/
|
|
36
|
-
displayJSON(): string;
|
|
37
|
-
abstract getDetails(): Promise<void>;
|
|
38
|
-
abstract getConfig(): Promise<void>;
|
|
39
|
-
abstract turnOn(): Promise<boolean>;
|
|
40
|
-
abstract turnOff(): Promise<boolean>;
|
|
41
|
-
/**
|
|
42
|
-
* Update device details
|
|
43
|
-
*/
|
|
44
|
-
update(): Promise<void>;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* VeSync Wall Switch
|
|
48
|
-
*/
|
|
49
|
-
export declare class VeSyncWallSwitch extends VeSyncSwitch {
|
|
50
|
-
constructor(details: Record<string, any>, manager: VeSync);
|
|
51
|
-
/**
|
|
52
|
-
* Get wall switch details
|
|
53
|
-
*/
|
|
54
|
-
getDetails(): Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
* Get switch device configuration info
|
|
57
|
-
*/
|
|
58
|
-
getConfig(): Promise<void>;
|
|
59
|
-
/**
|
|
60
|
-
* Turn off wall switch
|
|
61
|
-
*/
|
|
62
|
-
turnOff(): Promise<boolean>;
|
|
63
|
-
/**
|
|
64
|
-
* Turn on wall switch
|
|
65
|
-
*/
|
|
66
|
-
turnOn(): Promise<boolean>;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* VeSync Dimmer Switch
|
|
70
|
-
*/
|
|
71
|
-
export declare class VeSyncDimmerSwitch extends VeSyncSwitch {
|
|
72
|
-
private _brightness;
|
|
73
|
-
private _rgbValue;
|
|
74
|
-
private _rgbStatus;
|
|
75
|
-
private _indicatorLight;
|
|
76
|
-
constructor(details: Record<string, any>, manager: VeSync);
|
|
77
|
-
/**
|
|
78
|
-
* Get dimmer switch details
|
|
79
|
-
*/
|
|
80
|
-
getDetails(): Promise<void>;
|
|
81
|
-
/**
|
|
82
|
-
* Get dimmer switch configuration info
|
|
83
|
-
*/
|
|
84
|
-
getConfig(): Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* Turn off dimmer switch
|
|
87
|
-
*/
|
|
88
|
-
turnOff(): Promise<boolean>;
|
|
89
|
-
/**
|
|
90
|
-
* Turn on dimmer switch
|
|
91
|
-
*/
|
|
92
|
-
turnOn(): Promise<boolean>;
|
|
93
|
-
/**
|
|
94
|
-
* Return brightness in percent
|
|
95
|
-
*/
|
|
96
|
-
get brightness(): number;
|
|
97
|
-
/**
|
|
98
|
-
* Return faceplate brightness light status
|
|
99
|
-
*/
|
|
100
|
-
get indicatorLightStatus(): string;
|
|
101
|
-
/**
|
|
102
|
-
* Return RGB faceplate light status
|
|
103
|
-
*/
|
|
104
|
-
get rgbLightStatus(): string;
|
|
105
|
-
/**
|
|
106
|
-
* Return RGB light values
|
|
107
|
-
*/
|
|
108
|
-
get rgbLightValue(): Record<string, number>;
|
|
109
|
-
/**
|
|
110
|
-
* Update device details
|
|
111
|
-
*/
|
|
112
|
-
update(): Promise<void>;
|
|
113
|
-
/**
|
|
114
|
-
* Display device info
|
|
115
|
-
*/
|
|
116
|
-
display(): void;
|
|
117
|
-
/**
|
|
118
|
-
* Return JSON details for dimmer switch
|
|
119
|
-
*/
|
|
120
|
-
displayJSON(): string;
|
|
121
|
-
/**
|
|
122
|
-
* Set brightness level
|
|
123
|
-
* @param brightness - Brightness level (1-100)
|
|
124
|
-
*/
|
|
125
|
-
setBrightness(brightness: number): Promise<boolean>;
|
|
126
|
-
/**
|
|
127
|
-
* Toggle indicator light status
|
|
128
|
-
* @param status - Light status ('on' or 'off')
|
|
129
|
-
*/
|
|
130
|
-
indicatorLightToggle(status: string): Promise<boolean>;
|
|
131
|
-
/**
|
|
132
|
-
* Set RGB color values
|
|
133
|
-
* @param red - Red value (0-255)
|
|
134
|
-
* @param green - Green value (0-255)
|
|
135
|
-
* @param blue - Blue value (0-255)
|
|
136
|
-
*/
|
|
137
|
-
rgbColorSet(red: number, green: number, blue: number): Promise<boolean>;
|
|
138
|
-
/**
|
|
139
|
-
* Toggle switch status
|
|
140
|
-
* @param status - Switch status ('on' or 'off')
|
|
141
|
-
*/
|
|
142
|
-
switchToggle(status: string): Promise<boolean>;
|
|
143
|
-
/**
|
|
144
|
-
* Set faceplate RGB color status and optionally set RGB values
|
|
145
|
-
* @param status - RGB status ('on' or 'off')
|
|
146
|
-
* @param red - Optional red value (0-255)
|
|
147
|
-
* @param green - Optional green value (0-255)
|
|
148
|
-
* @param blue - Optional blue value (0-255)
|
|
149
|
-
*/
|
|
150
|
-
rgbColorStatus(status: string, red?: number, green?: number, blue?: number): Promise<boolean>;
|
|
151
|
-
/**
|
|
152
|
-
* Turn RGB Color Off
|
|
153
|
-
*/
|
|
154
|
-
rgbColorOff(): Promise<boolean>;
|
|
155
|
-
/**
|
|
156
|
-
* Turn RGB Color On
|
|
157
|
-
*/
|
|
158
|
-
rgbColorOn(): Promise<boolean>;
|
|
159
|
-
/**
|
|
160
|
-
* Turn indicator light on
|
|
161
|
-
*/
|
|
162
|
-
indicatorLightOn(): Promise<boolean>;
|
|
163
|
-
/**
|
|
164
|
-
* Turn indicator light off
|
|
165
|
-
*/
|
|
166
|
-
indicatorLightOff(): Promise<boolean>;
|
|
167
|
-
}
|
|
168
|
-
export declare const switchModules: Record<string, DeviceConstructor>;
|
|
169
|
-
export {};
|