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