tsvesync 1.0.11 → 1.0.12

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.
@@ -0,0 +1,644 @@
1
+ "use strict";
2
+ /**
3
+ * VeSync Fan Implementations
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.fanModules = exports.VeSyncWarmHumidifier = exports.VeSyncHumidifier = exports.VeSyncAirBypass = void 0;
7
+ const vesyncFan_1 = require("./vesyncFan");
8
+ const helpers_1 = require("./helpers");
9
+ /**
10
+ * VeSync Air Purifier with Bypass
11
+ */
12
+ class VeSyncAirBypass extends vesyncFan_1.VeSyncFan {
13
+ constructor(details, manager) {
14
+ super(details, manager);
15
+ this.modes = ['auto', 'manual', 'sleep'];
16
+ this.speeds = [1, 2, 3, 4, 5];
17
+ this.displayModes = ['on', 'off'];
18
+ this.childLockModes = ['on', 'off'];
19
+ }
20
+ /**
21
+ * Get device details
22
+ */
23
+ async getDetails() {
24
+ var _a;
25
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
26
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
27
+ cid: this.cid,
28
+ configModule: this.configModule,
29
+ payload: {
30
+ data: {},
31
+ method: 'getPurifierStatus',
32
+ source: 'APP'
33
+ }
34
+ }, helpers_1.Helpers.reqHeaderBypass());
35
+ if (this.checkResponse([response, status], 'getDetails')) {
36
+ const result = (_a = response === null || response === void 0 ? void 0 : response.result) === null || _a === void 0 ? void 0 : _a.result;
37
+ if (result) {
38
+ // Update device status
39
+ this.deviceStatus = result.enabled ? 'on' : 'off';
40
+ // Store device settings
41
+ this.details = {
42
+ mode: result.mode || '',
43
+ speed: result.level || 0,
44
+ filterLife: result.filter_life || 0,
45
+ screenStatus: result.display || false,
46
+ childLock: result.child_lock || false,
47
+ airQuality: result.air_quality || 0
48
+ };
49
+ // Store configuration if available
50
+ if (result.configuration) {
51
+ this.config = result.configuration;
52
+ }
53
+ }
54
+ }
55
+ }
56
+ /**
57
+ * Turn device on
58
+ */
59
+ async turnOn() {
60
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
61
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
62
+ cid: this.cid,
63
+ configModule: this.configModule,
64
+ payload: {
65
+ data: {
66
+ enabled: true,
67
+ id: 0
68
+ },
69
+ method: 'setSwitch',
70
+ source: 'APP'
71
+ }
72
+ }, helpers_1.Helpers.reqHeaderBypass());
73
+ return this.checkResponse([response, status], 'turnOn');
74
+ }
75
+ /**
76
+ * Turn device off
77
+ */
78
+ async turnOff() {
79
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
80
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
81
+ cid: this.cid,
82
+ configModule: this.configModule,
83
+ payload: {
84
+ data: {
85
+ enabled: false,
86
+ id: 0
87
+ },
88
+ method: 'setSwitch',
89
+ source: 'APP'
90
+ }
91
+ }, helpers_1.Helpers.reqHeaderBypass());
92
+ return this.checkResponse([response, status], 'turnOff');
93
+ }
94
+ /**
95
+ * Change fan speed
96
+ */
97
+ async changeFanSpeed(speed) {
98
+ if (!this.speeds.includes(speed)) {
99
+ throw new Error(`Invalid speed: ${speed}. Must be one of: ${this.speeds.join(', ')}`);
100
+ }
101
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
102
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
103
+ cid: this.cid,
104
+ configModule: this.configModule,
105
+ payload: {
106
+ data: {
107
+ id: 0,
108
+ level: speed,
109
+ mode: 'manual',
110
+ type: 'wind'
111
+ },
112
+ method: 'setLevel',
113
+ source: 'APP'
114
+ }
115
+ }, helpers_1.Helpers.reqHeaderBypass());
116
+ return this.checkResponse([response, status], 'changeFanSpeed');
117
+ }
118
+ /**
119
+ * Set device mode
120
+ */
121
+ async setMode(mode) {
122
+ if (!this.modes.includes(mode)) {
123
+ throw new Error(`Invalid mode: ${mode}. Must be one of: ${this.modes.join(', ')}`);
124
+ }
125
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
126
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
127
+ cid: this.cid,
128
+ configModule: this.configModule,
129
+ payload: {
130
+ data: {
131
+ mode
132
+ },
133
+ method: 'setPurifierMode',
134
+ source: 'APP'
135
+ }
136
+ }, helpers_1.Helpers.reqHeaderBypass());
137
+ return this.checkResponse([response, status], 'setMode');
138
+ }
139
+ /**
140
+ * Set display status
141
+ */
142
+ async setDisplay(enabled) {
143
+ if (!this.hasFeature('display')) {
144
+ throw new Error('Display control not supported');
145
+ }
146
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
147
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
148
+ cid: this.cid,
149
+ configModule: this.configModule,
150
+ payload: {
151
+ data: {
152
+ state: enabled
153
+ },
154
+ method: 'setDisplay',
155
+ source: 'APP'
156
+ }
157
+ }, helpers_1.Helpers.reqHeaderBypass());
158
+ return this.checkResponse([response, status], 'setDisplay');
159
+ }
160
+ /**
161
+ * Set child lock
162
+ */
163
+ async setChildLock(enabled) {
164
+ if (!this.hasFeature('child_lock')) {
165
+ throw new Error('Child lock not supported');
166
+ }
167
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
168
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
169
+ cid: this.cid,
170
+ configModule: this.configModule,
171
+ payload: {
172
+ data: {
173
+ state: enabled
174
+ },
175
+ method: 'setChildLock',
176
+ source: 'APP'
177
+ }
178
+ }, helpers_1.Helpers.reqHeaderBypass());
179
+ return this.checkResponse([response, status], 'setChildLock');
180
+ }
181
+ /**
182
+ * Set timer
183
+ */
184
+ async setTimer(hours) {
185
+ if (!this.hasFeature('timer')) {
186
+ throw new Error('Timer not supported');
187
+ }
188
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
189
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
190
+ cid: this.cid,
191
+ configModule: this.configModule,
192
+ payload: {
193
+ data: {
194
+ action: 'off',
195
+ total: hours * 3600
196
+ },
197
+ method: 'addTimer',
198
+ source: 'APP'
199
+ }
200
+ }, helpers_1.Helpers.reqHeaderBypass());
201
+ return this.checkResponse([response, status], 'setTimer');
202
+ }
203
+ /**
204
+ * Clear timer
205
+ */
206
+ async clearTimer() {
207
+ if (!this.hasFeature('timer')) {
208
+ throw new Error('Timer not supported');
209
+ }
210
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
211
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
212
+ cid: this.cid,
213
+ configModule: this.configModule,
214
+ payload: {
215
+ data: {},
216
+ method: 'deleteTimer',
217
+ source: 'APP'
218
+ }
219
+ }, helpers_1.Helpers.reqHeaderBypass());
220
+ return this.checkResponse([response, status], 'clearTimer');
221
+ }
222
+ /**
223
+ * Turn automatic stop on
224
+ */
225
+ async automaticStopOn() {
226
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
227
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
228
+ cid: this.cid,
229
+ configModule: this.configModule,
230
+ payload: {
231
+ data: {
232
+ enabled: true
233
+ },
234
+ method: 'setAutomaticStop',
235
+ source: 'APP'
236
+ }
237
+ }, helpers_1.Helpers.reqHeaderBypass());
238
+ return this.checkResponse([response, status], 'automaticStopOn');
239
+ }
240
+ /**
241
+ * Turn automatic stop off
242
+ */
243
+ async automaticStopOff() {
244
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
245
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
246
+ cid: this.cid,
247
+ configModule: this.configModule,
248
+ payload: {
249
+ data: {
250
+ enabled: false
251
+ },
252
+ method: 'setAutomaticStop',
253
+ source: 'APP'
254
+ }
255
+ }, helpers_1.Helpers.reqHeaderBypass());
256
+ return this.checkResponse([response, status], 'automaticStopOff');
257
+ }
258
+ }
259
+ exports.VeSyncAirBypass = VeSyncAirBypass;
260
+ /**
261
+ * VeSync Humidifier Base Class
262
+ */
263
+ class VeSyncHumidifier extends vesyncFan_1.VeSyncFan {
264
+ constructor(details, manager) {
265
+ super(details, manager);
266
+ this.modes = ['auto', 'manual', 'sleep'];
267
+ this.speeds = [1, 2, 3];
268
+ this.displayModes = ['on', 'off'];
269
+ this.mistLevels = [1, 2, 3];
270
+ this.humidityRange = { min: 30, max: 80 };
271
+ }
272
+ /**
273
+ * Get device details
274
+ */
275
+ async getDetails() {
276
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
277
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
278
+ cid: this.cid,
279
+ configModule: this.configModule,
280
+ payload: {
281
+ data: {},
282
+ method: 'getHumidifierStatus',
283
+ source: 'APP'
284
+ }
285
+ }, helpers_1.Helpers.reqHeaderBypass());
286
+ if (this.checkResponse([response, status], 'getDetails')) {
287
+ this.details = response.result.result;
288
+ }
289
+ }
290
+ /**
291
+ * Turn device on
292
+ */
293
+ async turnOn() {
294
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
295
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
296
+ cid: this.cid,
297
+ configModule: this.configModule,
298
+ payload: {
299
+ data: {
300
+ enabled: true,
301
+ id: 0
302
+ },
303
+ method: 'setSwitch',
304
+ source: 'APP'
305
+ }
306
+ }, helpers_1.Helpers.reqHeaderBypass());
307
+ return this.checkResponse([response, status], 'turnOn');
308
+ }
309
+ /**
310
+ * Turn device off
311
+ */
312
+ async turnOff() {
313
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
314
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
315
+ cid: this.cid,
316
+ configModule: this.configModule,
317
+ payload: {
318
+ data: {
319
+ enabled: false,
320
+ id: 0
321
+ },
322
+ method: 'setSwitch',
323
+ source: 'APP'
324
+ }
325
+ }, helpers_1.Helpers.reqHeaderBypass());
326
+ return this.checkResponse([response, status], 'turnOff');
327
+ }
328
+ /**
329
+ * Change fan speed
330
+ */
331
+ async changeFanSpeed(speed) {
332
+ if (!this.speeds.includes(speed)) {
333
+ throw new Error(`Invalid speed: ${speed}. Must be one of: ${this.speeds.join(', ')}`);
334
+ }
335
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
336
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
337
+ cid: this.cid,
338
+ configModule: this.configModule,
339
+ payload: {
340
+ data: {
341
+ id: 0,
342
+ level: speed,
343
+ type: 'wind'
344
+ },
345
+ method: 'setLevel',
346
+ source: 'APP'
347
+ }
348
+ }, helpers_1.Helpers.reqHeaderBypass());
349
+ return this.checkResponse([response, status], 'changeFanSpeed');
350
+ }
351
+ /**
352
+ * Set device mode
353
+ */
354
+ async setMode(mode) {
355
+ if (!this.modes.includes(mode)) {
356
+ throw new Error(`Invalid mode: ${mode}. Must be one of: ${this.modes.join(', ')}`);
357
+ }
358
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
359
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
360
+ cid: this.cid,
361
+ configModule: this.configModule,
362
+ payload: {
363
+ data: {
364
+ mode
365
+ },
366
+ method: 'setHumidifierMode',
367
+ source: 'APP'
368
+ }
369
+ }, helpers_1.Helpers.reqHeaderBypass());
370
+ return this.checkResponse([response, status], 'setMode');
371
+ }
372
+ /**
373
+ * Set mist level
374
+ */
375
+ async setMistLevel(level) {
376
+ if (!this.hasFeature('mist')) {
377
+ throw new Error('Mist control not supported');
378
+ }
379
+ if (!this.mistLevels.includes(level)) {
380
+ throw new Error(`Invalid mist level: ${level}. Must be one of: ${this.mistLevels.join(', ')}`);
381
+ }
382
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
383
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
384
+ cid: this.cid,
385
+ configModule: this.configModule,
386
+ payload: {
387
+ data: {
388
+ mistLevel: level
389
+ },
390
+ method: 'setMistLevel',
391
+ source: 'APP'
392
+ }
393
+ }, helpers_1.Helpers.reqHeaderBypass());
394
+ return this.checkResponse([response, status], 'setMistLevel');
395
+ }
396
+ /**
397
+ * Set target humidity
398
+ */
399
+ async setHumidity(humidity) {
400
+ if (!this.hasFeature('humidity')) {
401
+ throw new Error('Humidity control not supported');
402
+ }
403
+ if (humidity < this.humidityRange.min || humidity > this.humidityRange.max) {
404
+ throw new Error(`Invalid humidity: ${humidity}. Must be between ${this.humidityRange.min} and ${this.humidityRange.max}`);
405
+ }
406
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
407
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
408
+ cid: this.cid,
409
+ configModule: this.configModule,
410
+ payload: {
411
+ data: {
412
+ targetHumidity: humidity
413
+ },
414
+ method: 'setTargetHumidity',
415
+ source: 'APP'
416
+ }
417
+ }, helpers_1.Helpers.reqHeaderBypass());
418
+ return this.checkResponse([response, status], 'setHumidity');
419
+ }
420
+ /**
421
+ * Set display status
422
+ */
423
+ async setDisplay(enabled) {
424
+ if (!this.hasFeature('display')) {
425
+ throw new Error('Display control not supported');
426
+ }
427
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
428
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
429
+ cid: this.cid,
430
+ configModule: this.configModule,
431
+ payload: {
432
+ data: {
433
+ state: enabled
434
+ },
435
+ method: 'setDisplay',
436
+ source: 'APP'
437
+ }
438
+ }, helpers_1.Helpers.reqHeaderBypass());
439
+ return this.checkResponse([response, status], 'setDisplay');
440
+ }
441
+ /**
442
+ * Set timer
443
+ */
444
+ async setTimer(hours) {
445
+ if (!this.hasFeature('timer')) {
446
+ throw new Error('Timer not supported');
447
+ }
448
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
449
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
450
+ cid: this.cid,
451
+ configModule: this.configModule,
452
+ payload: {
453
+ data: {
454
+ action: 'off',
455
+ total: hours * 3600
456
+ },
457
+ method: 'addTimer',
458
+ source: 'APP'
459
+ }
460
+ }, helpers_1.Helpers.reqHeaderBypass());
461
+ return this.checkResponse([response, status], 'setTimer');
462
+ }
463
+ /**
464
+ * Clear timer
465
+ */
466
+ async clearTimer() {
467
+ if (!this.hasFeature('timer')) {
468
+ throw new Error('Timer not supported');
469
+ }
470
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
471
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
472
+ cid: this.cid,
473
+ configModule: this.configModule,
474
+ payload: {
475
+ data: {},
476
+ method: 'deleteTimer',
477
+ source: 'APP'
478
+ }
479
+ }, helpers_1.Helpers.reqHeaderBypass());
480
+ return this.checkResponse([response, status], 'clearTimer');
481
+ }
482
+ /**
483
+ * Turn automatic stop on
484
+ */
485
+ async automaticStopOn() {
486
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
487
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
488
+ cid: this.cid,
489
+ configModule: this.configModule,
490
+ payload: {
491
+ data: {
492
+ enabled: true
493
+ },
494
+ method: 'setAutomaticStop',
495
+ source: 'APP'
496
+ }
497
+ }, helpers_1.Helpers.reqHeaderBypass());
498
+ return this.checkResponse([response, status], 'automaticStopOn');
499
+ }
500
+ /**
501
+ * Turn automatic stop off
502
+ */
503
+ async automaticStopOff() {
504
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
505
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
506
+ cid: this.cid,
507
+ configModule: this.configModule,
508
+ payload: {
509
+ data: {
510
+ enabled: false
511
+ },
512
+ method: 'setAutomaticStop',
513
+ source: 'APP'
514
+ }
515
+ }, helpers_1.Helpers.reqHeaderBypass());
516
+ return this.checkResponse([response, status], 'automaticStopOff');
517
+ }
518
+ }
519
+ exports.VeSyncHumidifier = VeSyncHumidifier;
520
+ /**
521
+ * VeSync Warm Humidifier Class
522
+ */
523
+ class VeSyncWarmHumidifier extends VeSyncHumidifier {
524
+ constructor(details, manager) {
525
+ super(details, manager);
526
+ this.warmLevels = [1, 2, 3];
527
+ }
528
+ /**
529
+ * Set warm mist level
530
+ */
531
+ async setWarmLevel(level) {
532
+ if (!this.hasFeature('warm')) {
533
+ throw new Error('Warm mist control not supported');
534
+ }
535
+ if (!this.warmLevels.includes(level)) {
536
+ throw new Error(`Invalid warm level: ${level}. Must be one of: ${this.warmLevels.join(', ')}`);
537
+ }
538
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
539
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
540
+ cid: this.cid,
541
+ configModule: this.configModule,
542
+ payload: {
543
+ data: {
544
+ warmLevel: level
545
+ },
546
+ method: 'setWarmLevel',
547
+ source: 'APP'
548
+ }
549
+ }, helpers_1.Helpers.reqHeaderBypass());
550
+ return this.checkResponse([response, status], 'setWarmLevel');
551
+ }
552
+ /**
553
+ * Set drying mode enabled
554
+ */
555
+ async setDryingModeEnabled(enabled) {
556
+ if (!this.hasFeature('drying')) {
557
+ throw new Error('Drying mode not supported');
558
+ }
559
+ const [response, status] = await helpers_1.Helpers.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
560
+ ...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
561
+ cid: this.cid,
562
+ configModule: this.configModule,
563
+ payload: {
564
+ data: {
565
+ autoDryingSwitch: enabled ? 1 : 0
566
+ },
567
+ method: 'setDryingMode',
568
+ source: 'APP'
569
+ }
570
+ }, helpers_1.Helpers.reqHeaderBypass());
571
+ return this.checkResponse([response, status], 'setDryingModeEnabled');
572
+ }
573
+ }
574
+ exports.VeSyncWarmHumidifier = VeSyncWarmHumidifier;
575
+ // Export fan modules dictionary
576
+ exports.fanModules = {
577
+ // Core Series
578
+ 'Core200S': VeSyncAirBypass,
579
+ 'Core300S': VeSyncAirBypass,
580
+ 'Core400S': VeSyncAirBypass,
581
+ 'Core600S': VeSyncAirBypass,
582
+ // LAP Series
583
+ 'LAP-C201S-AUSR': VeSyncAirBypass,
584
+ 'LAP-C202S-WUSR': VeSyncAirBypass,
585
+ 'LAP-C301S-WJP': VeSyncAirBypass,
586
+ 'LAP-C302S-WUSB': VeSyncAirBypass,
587
+ 'LAP-C301S-WAAA': VeSyncAirBypass,
588
+ 'LAP-C401S-WJP': VeSyncAirBypass,
589
+ 'LAP-C401S-WUSR': VeSyncAirBypass,
590
+ 'LAP-C401S-WAAA': VeSyncAirBypass,
591
+ 'LAP-C601S-WUS': VeSyncAirBypass,
592
+ 'LAP-C601S-WUSR': VeSyncAirBypass,
593
+ 'LAP-C601S-WEU': VeSyncAirBypass,
594
+ 'LAP-V102S-AASR': VeSyncAirBypass,
595
+ 'LAP-V102S-WUS': VeSyncAirBypass,
596
+ 'LAP-V102S-WEU': VeSyncAirBypass,
597
+ 'LAP-V102S-AUSR': VeSyncAirBypass,
598
+ 'LAP-V102S-WJP': VeSyncAirBypass,
599
+ 'LAP-V201S-AASR': VeSyncAirBypass,
600
+ 'LAP-V201S-WJP': VeSyncAirBypass,
601
+ 'LAP-V201S-WEU': VeSyncAirBypass,
602
+ 'LAP-V201S-WUS': VeSyncAirBypass,
603
+ 'LAP-V201-AUSR': VeSyncAirBypass,
604
+ 'LAP-V201S-AUSR': VeSyncAirBypass,
605
+ 'LAP-V201S-AEUR': VeSyncAirBypass,
606
+ 'LAP-EL551S-AUS': VeSyncAirBypass,
607
+ 'LAP-EL551S-AEUR': VeSyncAirBypass,
608
+ 'LAP-EL551S-WEU': VeSyncAirBypass,
609
+ 'LAP-EL551S-WUS': VeSyncAirBypass,
610
+ // LTF Series
611
+ 'LTF-F422S-KEU': VeSyncAirBypass,
612
+ 'LTF-F422S-WUSR': VeSyncAirBypass,
613
+ 'LTF-F422_WJP': VeSyncAirBypass,
614
+ 'LTF-F422S-WUS': VeSyncAirBypass,
615
+ // Classic Series
616
+ 'Classic300S': VeSyncHumidifier,
617
+ 'Classic200S': VeSyncHumidifier,
618
+ // Dual Series
619
+ 'Dual200S': VeSyncHumidifier,
620
+ // LUH Series
621
+ 'LUH-A601S-WUSB': VeSyncWarmHumidifier,
622
+ 'LUH-A601S-AUSW': VeSyncWarmHumidifier,
623
+ 'LUH-D301S-WUSR': VeSyncWarmHumidifier,
624
+ 'LUH-D301S-WJP': VeSyncWarmHumidifier,
625
+ 'LUH-D301S-WEU': VeSyncWarmHumidifier,
626
+ 'LUH-A602S-WUSR': VeSyncWarmHumidifier,
627
+ 'LUH-A602S-WUS': VeSyncWarmHumidifier,
628
+ 'LUH-A602S-WEUR': VeSyncWarmHumidifier,
629
+ 'LUH-A602S-WEU': VeSyncWarmHumidifier,
630
+ 'LUH-A602S-WJP': VeSyncWarmHumidifier,
631
+ 'LUH-A602S-WUSC': VeSyncWarmHumidifier,
632
+ 'LUH-O451S-WEU': VeSyncWarmHumidifier,
633
+ 'LUH-O451S-WUS': VeSyncWarmHumidifier,
634
+ 'LUH-O451S-WUSR': VeSyncWarmHumidifier,
635
+ 'LUH-O601S-WUS': VeSyncWarmHumidifier,
636
+ 'LUH-O601S-KUS': VeSyncWarmHumidifier,
637
+ 'LUH-M101S-WUS': VeSyncWarmHumidifier,
638
+ // LEH Series
639
+ 'LEH-S601S-WUS': VeSyncWarmHumidifier,
640
+ 'LEH-S601S-WUSR': VeSyncWarmHumidifier,
641
+ // LV Series
642
+ 'LV-PUR131S': VeSyncAirBypass,
643
+ 'LV-RH131S': VeSyncAirBypass
644
+ };
@@ -0,0 +1,53 @@
1
+ /**
2
+ * VeSync Outlets
3
+ */
4
+ import { VeSyncBaseDevice } from './vesyncBaseDevice';
5
+ import { VeSync } from './vesync';
6
+ /**
7
+ * VeSync Outlet Base Class
8
+ */
9
+ export declare abstract class VeSyncOutlet extends VeSyncBaseDevice {
10
+ protected energy: Record<string, any>;
11
+ protected details: Record<string, any>;
12
+ constructor(details: Record<string, any>, manager: VeSync);
13
+ /**
14
+ * Get outlet details
15
+ */
16
+ getDetails(): Promise<void>;
17
+ /**
18
+ * Update outlet energy data
19
+ */
20
+ updateEnergy(): Promise<void>;
21
+ /**
22
+ * Get outlet energy usage
23
+ */
24
+ getEnergyUsage(): Promise<Record<string, any>>;
25
+ /**
26
+ * Get outlet status
27
+ */
28
+ getStatus(): Promise<string>;
29
+ /**
30
+ * Get weekly energy data
31
+ */
32
+ getWeeklyEnergy(): Promise<void>;
33
+ /**
34
+ * Get monthly energy data
35
+ */
36
+ getMonthlyEnergy(): Promise<void>;
37
+ /**
38
+ * Get yearly energy data
39
+ */
40
+ getYearlyEnergy(): Promise<void>;
41
+ /**
42
+ * Update outlet details and energy info
43
+ */
44
+ update(): Promise<void>;
45
+ /**
46
+ * Turn outlet on
47
+ */
48
+ abstract turnOn(): Promise<boolean>;
49
+ /**
50
+ * Turn outlet off
51
+ */
52
+ abstract turnOff(): Promise<boolean>;
53
+ }