tsvesync 1.0.13 → 1.0.14
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/package.json +1 -1
- 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,406 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* VeSync Fan Classes
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.VeSyncFan = exports.fanConfig = void 0;
|
|
7
|
-
const vesyncBaseDevice_1 = require("./vesyncBaseDevice");
|
|
8
|
-
// Fan configuration
|
|
9
|
-
exports.fanConfig = {
|
|
10
|
-
// Core Series
|
|
11
|
-
'Core200S': {
|
|
12
|
-
module: 'VeSyncAirBypass',
|
|
13
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
14
|
-
},
|
|
15
|
-
'Core300S': {
|
|
16
|
-
module: 'VeSyncAirBypass',
|
|
17
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
18
|
-
},
|
|
19
|
-
'Core400S': {
|
|
20
|
-
module: 'VeSyncAirBypass',
|
|
21
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
22
|
-
},
|
|
23
|
-
'Core600S': {
|
|
24
|
-
module: 'VeSyncAirBypass',
|
|
25
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
26
|
-
},
|
|
27
|
-
// LAP Series
|
|
28
|
-
'LAP-C201S-AUSR': {
|
|
29
|
-
module: 'VeSyncAirBypass',
|
|
30
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
31
|
-
},
|
|
32
|
-
'LAP-C202S-WUSR': {
|
|
33
|
-
module: 'VeSyncAirBypass',
|
|
34
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
35
|
-
},
|
|
36
|
-
'LAP-C301S-WJP': {
|
|
37
|
-
module: 'VeSyncAirBypass',
|
|
38
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
39
|
-
},
|
|
40
|
-
'LAP-C302S-WUSB': {
|
|
41
|
-
module: 'VeSyncAirBypass',
|
|
42
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
43
|
-
},
|
|
44
|
-
'LAP-C301S-WAAA': {
|
|
45
|
-
module: 'VeSyncAirBypass',
|
|
46
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
47
|
-
},
|
|
48
|
-
'LAP-C401S-WJP': {
|
|
49
|
-
module: 'VeSyncAirBypass',
|
|
50
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
51
|
-
},
|
|
52
|
-
'LAP-C401S-WUSR': {
|
|
53
|
-
module: 'VeSyncAirBypass',
|
|
54
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
55
|
-
},
|
|
56
|
-
'LAP-C401S-WAAA': {
|
|
57
|
-
module: 'VeSyncAirBypass',
|
|
58
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
59
|
-
},
|
|
60
|
-
'LAP-C601S-WUS': {
|
|
61
|
-
module: 'VeSyncAirBypass',
|
|
62
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
63
|
-
},
|
|
64
|
-
'LAP-C601S-WUSR': {
|
|
65
|
-
module: 'VeSyncAirBypass',
|
|
66
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
67
|
-
},
|
|
68
|
-
'LAP-C601S-WEU': {
|
|
69
|
-
module: 'VeSyncAirBypass',
|
|
70
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
71
|
-
},
|
|
72
|
-
'LAP-V102S-AASR': {
|
|
73
|
-
module: 'VeSyncAirBypass',
|
|
74
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
75
|
-
},
|
|
76
|
-
'LAP-V102S-WUS': {
|
|
77
|
-
module: 'VeSyncAirBypass',
|
|
78
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
79
|
-
},
|
|
80
|
-
'LAP-V102S-WEU': {
|
|
81
|
-
module: 'VeSyncAirBypass',
|
|
82
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
83
|
-
},
|
|
84
|
-
'LAP-V102S-AUSR': {
|
|
85
|
-
module: 'VeSyncAirBypass',
|
|
86
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
87
|
-
},
|
|
88
|
-
'LAP-V102S-WJP': {
|
|
89
|
-
module: 'VeSyncAirBypass',
|
|
90
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
91
|
-
},
|
|
92
|
-
'LAP-V201S-AASR': {
|
|
93
|
-
module: 'VeSyncAirBypass',
|
|
94
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
95
|
-
},
|
|
96
|
-
'LAP-V201S-WJP': {
|
|
97
|
-
module: 'VeSyncAirBypass',
|
|
98
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
99
|
-
},
|
|
100
|
-
'LAP-V201S-WEU': {
|
|
101
|
-
module: 'VeSyncAirBypass',
|
|
102
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
103
|
-
},
|
|
104
|
-
'LAP-V201S-WUS': {
|
|
105
|
-
module: 'VeSyncAirBypass',
|
|
106
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
107
|
-
},
|
|
108
|
-
'LAP-V201-AUSR': {
|
|
109
|
-
module: 'VeSyncAirBypass',
|
|
110
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
111
|
-
},
|
|
112
|
-
'LAP-V201S-AUSR': {
|
|
113
|
-
module: 'VeSyncAirBypass',
|
|
114
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
115
|
-
},
|
|
116
|
-
'LAP-V201S-AEUR': {
|
|
117
|
-
module: 'VeSyncAirBypass',
|
|
118
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
119
|
-
},
|
|
120
|
-
'LAP-EL551S-AUS': {
|
|
121
|
-
module: 'VeSyncAirBypass',
|
|
122
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
123
|
-
},
|
|
124
|
-
'LAP-EL551S-AEUR': {
|
|
125
|
-
module: 'VeSyncAirBypass',
|
|
126
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
127
|
-
},
|
|
128
|
-
'LAP-EL551S-WEU': {
|
|
129
|
-
module: 'VeSyncAirBypass',
|
|
130
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
131
|
-
},
|
|
132
|
-
'LAP-EL551S-WUS': {
|
|
133
|
-
module: 'VeSyncAirBypass',
|
|
134
|
-
features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
|
|
135
|
-
},
|
|
136
|
-
// LTF Series
|
|
137
|
-
'LTF-F422S-KEU': {
|
|
138
|
-
module: 'VeSyncAirBypass',
|
|
139
|
-
features: ['display', 'child_lock', 'night_light', 'timer']
|
|
140
|
-
},
|
|
141
|
-
'LTF-F422S-WUSR': {
|
|
142
|
-
module: 'VeSyncAirBypass',
|
|
143
|
-
features: ['display', 'child_lock', 'night_light', 'timer']
|
|
144
|
-
},
|
|
145
|
-
'LTF-F422_WJP': {
|
|
146
|
-
module: 'VeSyncAirBypass',
|
|
147
|
-
features: ['display', 'child_lock', 'night_light', 'timer']
|
|
148
|
-
},
|
|
149
|
-
'LTF-F422S-WUS': {
|
|
150
|
-
module: 'VeSyncAirBypass',
|
|
151
|
-
features: ['display', 'child_lock', 'night_light', 'timer']
|
|
152
|
-
},
|
|
153
|
-
// Classic Series
|
|
154
|
-
'Classic300S': {
|
|
155
|
-
module: 'VeSyncHumidifier',
|
|
156
|
-
features: ['display', 'humidity', 'mist', 'timer', 'auto_mode']
|
|
157
|
-
},
|
|
158
|
-
'Classic200S': {
|
|
159
|
-
module: 'VeSyncHumidifier',
|
|
160
|
-
features: ['display', 'humidity', 'mist', 'timer', 'auto_mode']
|
|
161
|
-
},
|
|
162
|
-
// Dual Series
|
|
163
|
-
'Dual200S': {
|
|
164
|
-
module: 'VeSyncHumidifier',
|
|
165
|
-
features: ['display', 'humidity', 'mist', 'timer', 'auto_mode']
|
|
166
|
-
},
|
|
167
|
-
// LUH Series
|
|
168
|
-
'LUH-A601S-WUSB': {
|
|
169
|
-
module: 'VeSyncWarmHumidifier',
|
|
170
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
171
|
-
},
|
|
172
|
-
'LUH-A601S-AUSW': {
|
|
173
|
-
module: 'VeSyncWarmHumidifier',
|
|
174
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
175
|
-
},
|
|
176
|
-
'LUH-D301S-WUSR': {
|
|
177
|
-
module: 'VeSyncWarmHumidifier',
|
|
178
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
179
|
-
},
|
|
180
|
-
'LUH-D301S-WJP': {
|
|
181
|
-
module: 'VeSyncWarmHumidifier',
|
|
182
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
183
|
-
},
|
|
184
|
-
'LUH-D301S-WEU': {
|
|
185
|
-
module: 'VeSyncWarmHumidifier',
|
|
186
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
187
|
-
},
|
|
188
|
-
'LUH-A602S-WUSR': {
|
|
189
|
-
module: 'VeSyncWarmHumidifier',
|
|
190
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
191
|
-
},
|
|
192
|
-
'LUH-A602S-WUS': {
|
|
193
|
-
module: 'VeSyncWarmHumidifier',
|
|
194
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
195
|
-
},
|
|
196
|
-
'LUH-A602S-WEUR': {
|
|
197
|
-
module: 'VeSyncWarmHumidifier',
|
|
198
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
199
|
-
},
|
|
200
|
-
'LUH-A602S-WEU': {
|
|
201
|
-
module: 'VeSyncWarmHumidifier',
|
|
202
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
203
|
-
},
|
|
204
|
-
'LUH-A602S-WJP': {
|
|
205
|
-
module: 'VeSyncWarmHumidifier',
|
|
206
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
207
|
-
},
|
|
208
|
-
'LUH-A602S-WUSC': {
|
|
209
|
-
module: 'VeSyncWarmHumidifier',
|
|
210
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
211
|
-
},
|
|
212
|
-
'LUH-O451S-WEU': {
|
|
213
|
-
module: 'VeSyncWarmHumidifier',
|
|
214
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
215
|
-
},
|
|
216
|
-
'LUH-O451S-WUS': {
|
|
217
|
-
module: 'VeSyncWarmHumidifier',
|
|
218
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
219
|
-
},
|
|
220
|
-
'LUH-O451S-WUSR': {
|
|
221
|
-
module: 'VeSyncWarmHumidifier',
|
|
222
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
223
|
-
},
|
|
224
|
-
'LUH-O601S-WUS': {
|
|
225
|
-
module: 'VeSyncWarmHumidifier',
|
|
226
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
227
|
-
},
|
|
228
|
-
'LUH-O601S-KUS': {
|
|
229
|
-
module: 'VeSyncWarmHumidifier',
|
|
230
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
231
|
-
},
|
|
232
|
-
'LUH-M101S-WUS': {
|
|
233
|
-
module: 'VeSyncWarmHumidifier',
|
|
234
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode']
|
|
235
|
-
},
|
|
236
|
-
// LEH Series
|
|
237
|
-
'LEH-S601S-WUS': {
|
|
238
|
-
module: 'VeSyncWarmHumidifier',
|
|
239
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode', 'drying']
|
|
240
|
-
},
|
|
241
|
-
'LEH-S601S-WUSR': {
|
|
242
|
-
module: 'VeSyncWarmHumidifier',
|
|
243
|
-
features: ['display', 'humidity', 'mist', 'warm', 'timer', 'auto_mode', 'drying']
|
|
244
|
-
},
|
|
245
|
-
// LV Series
|
|
246
|
-
'LV-PUR131S': {
|
|
247
|
-
module: 'VeSyncAirBypass',
|
|
248
|
-
features: ['air_quality', 'display', 'child_lock', 'night_light', 'timer']
|
|
249
|
-
},
|
|
250
|
-
'LV-RH131S': {
|
|
251
|
-
module: 'VeSyncAirBypass',
|
|
252
|
-
features: ['display', 'child_lock', 'night_light', 'timer']
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
/**
|
|
256
|
-
* Base class for VeSync Fans
|
|
257
|
-
*/
|
|
258
|
-
class VeSyncFan extends vesyncBaseDevice_1.VeSyncBaseDevice {
|
|
259
|
-
constructor(details, manager) {
|
|
260
|
-
super(details, manager);
|
|
261
|
-
this.details = {};
|
|
262
|
-
this.mode_dict = {};
|
|
263
|
-
this.speed_dict = {};
|
|
264
|
-
this.features = [];
|
|
265
|
-
this.details = details;
|
|
266
|
-
this.features = exports.fanConfig[this.deviceType]?.features || [];
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Check if feature is supported
|
|
270
|
-
*/
|
|
271
|
-
hasFeature(feature) {
|
|
272
|
-
return this.features.includes(feature);
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Get current mode
|
|
276
|
-
*/
|
|
277
|
-
get mode() {
|
|
278
|
-
return this.details.mode ?? '';
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* Get current speed
|
|
282
|
-
*/
|
|
283
|
-
get speed() {
|
|
284
|
-
return this.details.speed ?? 0;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Get filter life percentage
|
|
288
|
-
*/
|
|
289
|
-
get filterLife() {
|
|
290
|
-
return this.details.filter_life ?? 0;
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Get screen status
|
|
294
|
-
*/
|
|
295
|
-
get screenStatus() {
|
|
296
|
-
return this.details.screen_status ?? '';
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Get child lock status
|
|
300
|
-
*/
|
|
301
|
-
get childLock() {
|
|
302
|
-
return this.details.child_lock ?? '';
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Get air quality (if supported)
|
|
306
|
-
*/
|
|
307
|
-
get airQuality() {
|
|
308
|
-
return this.details.air_quality ?? '';
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Get humidity level (if supported)
|
|
312
|
-
*/
|
|
313
|
-
get humidity() {
|
|
314
|
-
return this.details.humidity ?? 0;
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Get mist level (if supported)
|
|
318
|
-
*/
|
|
319
|
-
get mistLevel() {
|
|
320
|
-
return this.details.mist_level ?? 0;
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Get warm level (if supported)
|
|
324
|
-
*/
|
|
325
|
-
get warmLevel() {
|
|
326
|
-
return this.details.warm_level ?? 0;
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Get timer status
|
|
330
|
-
*/
|
|
331
|
-
get timer() {
|
|
332
|
-
return this.details.timer ?? 0;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Return formatted device info to stdout
|
|
336
|
-
*/
|
|
337
|
-
display() {
|
|
338
|
-
super.display();
|
|
339
|
-
const info = [
|
|
340
|
-
['Mode: ', this.mode],
|
|
341
|
-
['Speed: ', this.speed],
|
|
342
|
-
['Filter Life: ', this.filterLife, '%']
|
|
343
|
-
];
|
|
344
|
-
if (this.hasFeature('display')) {
|
|
345
|
-
info.push(['Screen Status: ', this.screenStatus]);
|
|
346
|
-
}
|
|
347
|
-
if (this.hasFeature('child_lock')) {
|
|
348
|
-
info.push(['Child Lock: ', this.childLock]);
|
|
349
|
-
}
|
|
350
|
-
if (this.hasFeature('air_quality')) {
|
|
351
|
-
info.push(['Air Quality: ', this.airQuality]);
|
|
352
|
-
}
|
|
353
|
-
if (this.hasFeature('humidity')) {
|
|
354
|
-
info.push(['Humidity: ', this.humidity, '%']);
|
|
355
|
-
}
|
|
356
|
-
if (this.hasFeature('mist')) {
|
|
357
|
-
info.push(['Mist Level: ', this.mistLevel]);
|
|
358
|
-
}
|
|
359
|
-
if (this.hasFeature('warm')) {
|
|
360
|
-
info.push(['Warm Level: ', this.warmLevel]);
|
|
361
|
-
}
|
|
362
|
-
if (this.hasFeature('timer')) {
|
|
363
|
-
info.push(['Timer: ', this.timer, 'hours']);
|
|
364
|
-
}
|
|
365
|
-
for (const [key, value, unit = ''] of info) {
|
|
366
|
-
console.log(`${key.toString().padEnd(30, '.')} ${value}${unit}`);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Return JSON details for fan
|
|
371
|
-
*/
|
|
372
|
-
displayJSON() {
|
|
373
|
-
const baseInfo = JSON.parse(super.displayJSON());
|
|
374
|
-
const details = {
|
|
375
|
-
'Mode': this.mode,
|
|
376
|
-
'Speed': this.speed.toString(),
|
|
377
|
-
'Filter Life': this.filterLife.toString()
|
|
378
|
-
};
|
|
379
|
-
if (this.hasFeature('display')) {
|
|
380
|
-
details['Screen Status'] = this.screenStatus;
|
|
381
|
-
}
|
|
382
|
-
if (this.hasFeature('child_lock')) {
|
|
383
|
-
details['Child Lock'] = this.childLock;
|
|
384
|
-
}
|
|
385
|
-
if (this.hasFeature('air_quality')) {
|
|
386
|
-
details['Air Quality'] = this.airQuality;
|
|
387
|
-
}
|
|
388
|
-
if (this.hasFeature('humidity')) {
|
|
389
|
-
details['Humidity'] = this.humidity.toString();
|
|
390
|
-
}
|
|
391
|
-
if (this.hasFeature('mist')) {
|
|
392
|
-
details['Mist Level'] = this.mistLevel.toString();
|
|
393
|
-
}
|
|
394
|
-
if (this.hasFeature('warm')) {
|
|
395
|
-
details['Warm Level'] = this.warmLevel.toString();
|
|
396
|
-
}
|
|
397
|
-
if (this.hasFeature('timer')) {
|
|
398
|
-
details['Timer'] = this.timer.toString();
|
|
399
|
-
}
|
|
400
|
-
return JSON.stringify({
|
|
401
|
-
...baseInfo,
|
|
402
|
-
...details
|
|
403
|
-
}, null, 4);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
exports.VeSyncFan = VeSyncFan;
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* VeSync Fan Implementations
|
|
3
|
-
*/
|
|
4
|
-
import { VeSyncFan } from './vesyncFan';
|
|
5
|
-
import { VeSync } from './vesync';
|
|
6
|
-
/**
|
|
7
|
-
* VeSync Air Purifier with Bypass
|
|
8
|
-
*/
|
|
9
|
-
export declare class VeSyncAirBypass extends VeSyncFan {
|
|
10
|
-
protected readonly modes: readonly ["auto", "manual", "sleep"];
|
|
11
|
-
protected readonly speeds: number[];
|
|
12
|
-
protected readonly displayModes: readonly ["on", "off"];
|
|
13
|
-
protected readonly childLockModes: readonly ["on", "off"];
|
|
14
|
-
constructor(details: Record<string, any>, manager: VeSync);
|
|
15
|
-
/**
|
|
16
|
-
* Get device details
|
|
17
|
-
*/
|
|
18
|
-
getDetails(): Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Turn device on
|
|
21
|
-
*/
|
|
22
|
-
turnOn(): Promise<boolean>;
|
|
23
|
-
/**
|
|
24
|
-
* Turn device off
|
|
25
|
-
*/
|
|
26
|
-
turnOff(): Promise<boolean>;
|
|
27
|
-
/**
|
|
28
|
-
* Change fan speed
|
|
29
|
-
*/
|
|
30
|
-
changeFanSpeed(speed: number): Promise<boolean>;
|
|
31
|
-
/**
|
|
32
|
-
* Set device mode
|
|
33
|
-
*/
|
|
34
|
-
setMode(mode: string): Promise<boolean>;
|
|
35
|
-
/**
|
|
36
|
-
* Set display status
|
|
37
|
-
*/
|
|
38
|
-
setDisplay(enabled: boolean): Promise<boolean>;
|
|
39
|
-
/**
|
|
40
|
-
* Set child lock
|
|
41
|
-
*/
|
|
42
|
-
setChildLock(enabled: boolean): Promise<boolean>;
|
|
43
|
-
/**
|
|
44
|
-
* Set timer
|
|
45
|
-
*/
|
|
46
|
-
setTimer(hours: number): Promise<boolean>;
|
|
47
|
-
/**
|
|
48
|
-
* Clear timer
|
|
49
|
-
*/
|
|
50
|
-
clearTimer(): Promise<boolean>;
|
|
51
|
-
/**
|
|
52
|
-
* Turn automatic stop on
|
|
53
|
-
*/
|
|
54
|
-
automaticStopOn(): Promise<boolean>;
|
|
55
|
-
/**
|
|
56
|
-
* Turn automatic stop off
|
|
57
|
-
*/
|
|
58
|
-
automaticStopOff(): Promise<boolean>;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* VeSync Humidifier Base Class
|
|
62
|
-
*/
|
|
63
|
-
export declare class VeSyncHumidifier extends VeSyncFan {
|
|
64
|
-
protected readonly modes: readonly ["auto", "manual", "sleep"];
|
|
65
|
-
protected readonly speeds: number[];
|
|
66
|
-
protected readonly displayModes: readonly ["on", "off"];
|
|
67
|
-
protected readonly mistLevels: number[];
|
|
68
|
-
protected readonly humidityRange: {
|
|
69
|
-
min: number;
|
|
70
|
-
max: number;
|
|
71
|
-
};
|
|
72
|
-
constructor(details: Record<string, any>, manager: VeSync);
|
|
73
|
-
/**
|
|
74
|
-
* Get device details
|
|
75
|
-
*/
|
|
76
|
-
getDetails(): Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Turn device on
|
|
79
|
-
*/
|
|
80
|
-
turnOn(): Promise<boolean>;
|
|
81
|
-
/**
|
|
82
|
-
* Turn device off
|
|
83
|
-
*/
|
|
84
|
-
turnOff(): Promise<boolean>;
|
|
85
|
-
/**
|
|
86
|
-
* Change fan speed
|
|
87
|
-
*/
|
|
88
|
-
changeFanSpeed(speed: number): Promise<boolean>;
|
|
89
|
-
/**
|
|
90
|
-
* Set device mode
|
|
91
|
-
*/
|
|
92
|
-
setMode(mode: string): Promise<boolean>;
|
|
93
|
-
/**
|
|
94
|
-
* Set mist level
|
|
95
|
-
*/
|
|
96
|
-
setMistLevel(level: number): Promise<boolean>;
|
|
97
|
-
/**
|
|
98
|
-
* Set target humidity
|
|
99
|
-
*/
|
|
100
|
-
setHumidity(humidity: number): Promise<boolean>;
|
|
101
|
-
/**
|
|
102
|
-
* Set display status
|
|
103
|
-
*/
|
|
104
|
-
setDisplay(enabled: boolean): Promise<boolean>;
|
|
105
|
-
/**
|
|
106
|
-
* Set timer
|
|
107
|
-
*/
|
|
108
|
-
setTimer(hours: number): Promise<boolean>;
|
|
109
|
-
/**
|
|
110
|
-
* Clear timer
|
|
111
|
-
*/
|
|
112
|
-
clearTimer(): Promise<boolean>;
|
|
113
|
-
/**
|
|
114
|
-
* Turn automatic stop on
|
|
115
|
-
*/
|
|
116
|
-
automaticStopOn(): Promise<boolean>;
|
|
117
|
-
/**
|
|
118
|
-
* Turn automatic stop off
|
|
119
|
-
*/
|
|
120
|
-
automaticStopOff(): Promise<boolean>;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* VeSync Warm Humidifier Class
|
|
124
|
-
*/
|
|
125
|
-
export declare class VeSyncWarmHumidifier extends VeSyncHumidifier {
|
|
126
|
-
protected readonly warmLevels: number[];
|
|
127
|
-
constructor(details: Record<string, any>, manager: VeSync);
|
|
128
|
-
/**
|
|
129
|
-
* Set warm mist level
|
|
130
|
-
*/
|
|
131
|
-
setWarmLevel(level: number): Promise<boolean>;
|
|
132
|
-
/**
|
|
133
|
-
* Set drying mode enabled
|
|
134
|
-
*/
|
|
135
|
-
setDryingModeEnabled(enabled: boolean): Promise<boolean>;
|
|
136
|
-
}
|
|
137
|
-
export declare const fanModules: Record<string, new (details: Record<string, any>, manager: VeSync) => VeSyncFan>;
|