tsvesync 1.0.43 → 1.0.44

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.
@@ -8,7 +8,7 @@ import { logger } from './logger';
8
8
 
9
9
  interface FanConfig {
10
10
  [key: string]: {
11
- module: 'VeSyncAirBypass' | 'VeSyncHumidifier' | 'VeSyncWarmHumidifier' | 'VeSyncTowerFan';
11
+ module: 'VeSyncAirBypass' | 'VeSyncHumidifier' | 'VeSyncWarmHumidifier' | 'VeSyncTowerFan' | 'VeSyncAirBaseV2';
12
12
  features: string[];
13
13
  };
14
14
  }
@@ -79,68 +79,68 @@ export const fanConfig: FanConfig = {
79
79
  features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
80
80
  },
81
81
  'LAP-V102S-AASR': {
82
- module: 'VeSyncAirBypass',
82
+ module: 'VeSyncAirBaseV2',
83
83
  features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
84
84
  },
85
85
  'LAP-V102S-WUS': {
86
- module: 'VeSyncAirBypass',
86
+ module: 'VeSyncAirBaseV2',
87
87
  features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
88
88
  },
89
89
  'LAP-V102S-WEU': {
90
- module: 'VeSyncAirBypass',
90
+ module: 'VeSyncAirBaseV2',
91
91
  features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
92
92
  },
93
93
  'LAP-V102S-AUSR': {
94
- module: 'VeSyncAirBypass',
94
+ module: 'VeSyncAirBaseV2',
95
95
  features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
96
96
  },
97
97
  'LAP-V102S-WJP': {
98
- module: 'VeSyncAirBypass',
98
+ module: 'VeSyncAirBaseV2',
99
99
  features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
100
100
  },
101
101
  'LAP-V201S-AASR': {
102
- module: 'VeSyncAirBypass',
103
- features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
102
+ module: 'VeSyncAirBaseV2',
103
+ features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer', 'light_detection']
104
104
  },
105
105
  'LAP-V201S-WJP': {
106
- module: 'VeSyncAirBypass',
107
- features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
106
+ module: 'VeSyncAirBaseV2',
107
+ features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer', 'light_detection']
108
108
  },
109
109
  'LAP-V201S-WEU': {
110
- module: 'VeSyncAirBypass',
111
- features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
110
+ module: 'VeSyncAirBaseV2',
111
+ features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer', 'light_detection']
112
112
  },
113
113
  'LAP-V201S-WUS': {
114
- module: 'VeSyncAirBypass',
115
- features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
114
+ module: 'VeSyncAirBaseV2',
115
+ features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer', 'light_detection']
116
116
  },
117
117
  'LAP-V201-AUSR': {
118
- module: 'VeSyncAirBypass',
119
- features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
118
+ module: 'VeSyncAirBaseV2',
119
+ features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer', 'light_detection']
120
120
  },
121
121
  'LAP-V201S-AUSR': {
122
- module: 'VeSyncAirBypass',
123
- features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
122
+ module: 'VeSyncAirBaseV2',
123
+ features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer', 'light_detection']
124
124
  },
125
125
  'LAP-V201S-AEUR': {
126
- module: 'VeSyncAirBypass',
127
- features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
126
+ module: 'VeSyncAirBaseV2',
127
+ features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer', 'light_detection']
128
128
  },
129
129
  'LAP-EL551S-AUS': {
130
- module: 'VeSyncAirBypass',
131
- features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
130
+ module: 'VeSyncAirBaseV2',
131
+ features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer', 'fan_rotate']
132
132
  },
133
133
  'LAP-EL551S-AEUR': {
134
- module: 'VeSyncAirBypass',
135
- features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
134
+ module: 'VeSyncAirBaseV2',
135
+ features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer', 'fan_rotate']
136
136
  },
137
137
  'LAP-EL551S-WEU': {
138
- module: 'VeSyncAirBypass',
139
- features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
138
+ module: 'VeSyncAirBaseV2',
139
+ features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer', 'fan_rotate']
140
140
  },
141
141
  'LAP-EL551S-WUS': {
142
- module: 'VeSyncAirBypass',
143
- features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer']
142
+ module: 'VeSyncAirBaseV2',
143
+ features: ['display', 'child_lock', 'night_light', 'air_quality', 'timer', 'fan_rotate']
144
144
  },
145
145
 
146
146
  // LTF Series
@@ -280,6 +280,7 @@ export abstract class VeSyncFan extends VeSyncBaseDevice {
280
280
  protected mode_dict: Record<string, any> = {};
281
281
  protected speed_dict: Record<string, any> = {};
282
282
  protected features: string[] = [];
283
+ protected _timer: number | { duration: number; action: string } | null = null;
283
284
 
284
285
  constructor(details: Record<string, any>, manager: VeSync) {
285
286
  super(details, manager);
@@ -360,8 +361,12 @@ export abstract class VeSyncFan extends VeSyncBaseDevice {
360
361
  /**
361
362
  * Get timer status
362
363
  */
363
- get timer(): number {
364
- return this.details.timer ?? 0;
364
+ get timer(): number | { duration: number; action: string } | null {
365
+ return this._timer;
366
+ }
367
+
368
+ set timer(value: number | { duration: number; action: string } | null) {
369
+ this._timer = value;
365
370
  }
366
371
 
367
372
  /**
@@ -393,8 +398,13 @@ export abstract class VeSyncFan extends VeSyncBaseDevice {
393
398
  if (this.hasFeature('warm')) {
394
399
  info.push(['Warm Level: ', this.warmLevel]);
395
400
  }
396
- if (this.hasFeature('timer')) {
397
- info.push(['Timer: ', this.timer, 'hours']);
401
+ if (this.hasFeature('timer') && this.timer) {
402
+ if (typeof this.timer === 'number') {
403
+ info.push(['Timer: ', this.timer, 'hours']);
404
+ } else {
405
+ info.push(['Timer: ', this.timer.duration, 'seconds']);
406
+ info.push(['Timer Action: ', this.timer.action]);
407
+ }
398
408
  }
399
409
 
400
410
  for (const [key, value, unit = ''] of info) {
@@ -431,8 +441,13 @@ export abstract class VeSyncFan extends VeSyncBaseDevice {
431
441
  if (this.hasFeature('warm')) {
432
442
  details['Warm Level'] = this.warmLevel.toString();
433
443
  }
434
- if (this.hasFeature('timer')) {
435
- details['Timer'] = this.timer.toString();
444
+ if (this.hasFeature('timer') && this.timer) {
445
+ if (typeof this.timer === 'number') {
446
+ details['Timer'] = this.timer.toString();
447
+ } else {
448
+ details['Timer'] = this.timer.duration.toString();
449
+ details['Timer Action'] = this.timer.action;
450
+ }
436
451
  }
437
452
 
438
453
  return JSON.stringify({