tsvesync 1.0.23 → 1.0.24
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/README.md +12 -0
- package/dist/lib/helpers.d.ts +1 -1
- package/dist/lib/helpers.js +13 -2
- package/dist/lib/vesync.d.ts +4 -0
- package/dist/lib/vesync.js +8 -2
- package/dist/lib/vesyncBaseDevice.d.ts +4 -0
- package/dist/lib/vesyncBaseDevice.js +7 -0
- package/dist/lib/vesyncBulb.js +4 -4
- package/dist/lib/vesyncBulbImpl.js +6 -6
- package/dist/lib/vesyncFanImpl.js +25 -25
- package/dist/lib/vesyncOutlet.js +5 -5
- package/dist/lib/vesyncOutletImpl.js +10 -10
- package/dist/lib/vesyncSwitchImpl.js +14 -14
- package/package.json +1 -1
- package/src/lib/helpers.ts +16 -2
- package/src/lib/vesync.ts +17 -2
- package/src/lib/vesyncBaseDevice.ts +13 -0
- package/src/lib/vesyncBulb.ts +4 -4
- package/src/lib/vesyncBulbImpl.ts +6 -6
- package/src/lib/vesyncFanImpl.ts +25 -25
- package/src/lib/vesyncOutlet.ts +5 -5
- package/src/lib/vesyncOutletImpl.ts +10 -12
- package/src/lib/vesyncSwitchImpl.ts +14 -14
|
@@ -21,7 +21,7 @@ export class VeSyncOutlet7A extends VeSyncOutlet {
|
|
|
21
21
|
async turnOn(): Promise<boolean> {
|
|
22
22
|
logger.debug(`[${this.deviceName}] Turning outlet on`);
|
|
23
23
|
const url = `/v1/wifi-switch-1.3/${this.cid}/status/on`;
|
|
24
|
-
const [response, statusCode] = await
|
|
24
|
+
const [response, statusCode] = await this.callApi(
|
|
25
25
|
url,
|
|
26
26
|
'put',
|
|
27
27
|
{},
|
|
@@ -43,7 +43,7 @@ export class VeSyncOutlet7A extends VeSyncOutlet {
|
|
|
43
43
|
async turnOff(): Promise<boolean> {
|
|
44
44
|
logger.debug(`[${this.deviceName}] Turning outlet off`);
|
|
45
45
|
const url = `/v1/wifi-switch-1.3/${this.cid}/status/off`;
|
|
46
|
-
const [response, statusCode] = await
|
|
46
|
+
const [response, statusCode] = await this.callApi(
|
|
47
47
|
url,
|
|
48
48
|
'put',
|
|
49
49
|
{},
|
|
@@ -79,7 +79,7 @@ export class VeSyncOutlet10A extends VeSyncOutlet {
|
|
|
79
79
|
status: 'on'
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
const [response] = await
|
|
82
|
+
const [response] = await this.callApi(
|
|
83
83
|
'/10a/v1/device/devicestatus',
|
|
84
84
|
'put',
|
|
85
85
|
body,
|
|
@@ -106,7 +106,7 @@ export class VeSyncOutlet10A extends VeSyncOutlet {
|
|
|
106
106
|
status: 'off'
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
const [response] = await
|
|
109
|
+
const [response] = await this.callApi(
|
|
110
110
|
'/10a/v1/device/devicestatus',
|
|
111
111
|
'put',
|
|
112
112
|
body,
|
|
@@ -142,7 +142,7 @@ export class VeSyncOutlet15A extends VeSyncOutlet {
|
|
|
142
142
|
status: 'on'
|
|
143
143
|
};
|
|
144
144
|
|
|
145
|
-
const [response] = await
|
|
145
|
+
const [response] = await this.callApi(
|
|
146
146
|
'/15a/v1/device/devicestatus',
|
|
147
147
|
'put',
|
|
148
148
|
body,
|
|
@@ -169,7 +169,7 @@ export class VeSyncOutlet15A extends VeSyncOutlet {
|
|
|
169
169
|
status: 'off'
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
-
const [response] = await
|
|
172
|
+
const [response] = await this.callApi(
|
|
173
173
|
'/15a/v1/device/devicestatus',
|
|
174
174
|
'put',
|
|
175
175
|
body,
|
|
@@ -201,7 +201,7 @@ export class VeSyncOutlet15A extends VeSyncOutlet {
|
|
|
201
201
|
mode: 'auto'
|
|
202
202
|
};
|
|
203
203
|
|
|
204
|
-
const [response] = await
|
|
204
|
+
const [response] = await this.callApi(
|
|
205
205
|
'/15a/v1/device/nightlightstatus',
|
|
206
206
|
'put',
|
|
207
207
|
body,
|
|
@@ -233,7 +233,7 @@ export class VeSyncOutlet15A extends VeSyncOutlet {
|
|
|
233
233
|
mode: 'manual'
|
|
234
234
|
};
|
|
235
235
|
|
|
236
|
-
const [response] = await
|
|
236
|
+
const [response] = await this.callApi(
|
|
237
237
|
'/15a/v1/device/nightlightstatus',
|
|
238
238
|
'put',
|
|
239
239
|
body,
|
|
@@ -267,7 +267,6 @@ export class VeSyncOutdoorPlug extends VeSyncOutlet {
|
|
|
267
267
|
* Turn outlet on
|
|
268
268
|
*/
|
|
269
269
|
async turnOn(): Promise<boolean> {
|
|
270
|
-
|
|
271
270
|
logger.debug(`[${this.deviceName}] Turning outlet on`);
|
|
272
271
|
const body = {
|
|
273
272
|
...Helpers.reqBody(this.manager, 'devicestatus'),
|
|
@@ -276,7 +275,7 @@ export class VeSyncOutdoorPlug extends VeSyncOutlet {
|
|
|
276
275
|
switchNo: this.subDeviceNo
|
|
277
276
|
};
|
|
278
277
|
|
|
279
|
-
const [response] = await
|
|
278
|
+
const [response] = await this.callApi(
|
|
280
279
|
'/outdoorsocket15a/v1/device/devicestatus',
|
|
281
280
|
'put',
|
|
282
281
|
body,
|
|
@@ -296,7 +295,6 @@ export class VeSyncOutdoorPlug extends VeSyncOutlet {
|
|
|
296
295
|
* Turn outlet off
|
|
297
296
|
*/
|
|
298
297
|
async turnOff(): Promise<boolean> {
|
|
299
|
-
|
|
300
298
|
logger.debug(`[${this.deviceName}] Turning outlet off`);
|
|
301
299
|
const body = {
|
|
302
300
|
...Helpers.reqBody(this.manager, 'devicestatus'),
|
|
@@ -305,7 +303,7 @@ export class VeSyncOutdoorPlug extends VeSyncOutlet {
|
|
|
305
303
|
switchNo: this.subDeviceNo
|
|
306
304
|
};
|
|
307
305
|
|
|
308
|
-
const [response] = await
|
|
306
|
+
const [response] = await this.callApi(
|
|
309
307
|
'/outdoorsocket15a/v1/device/devicestatus',
|
|
310
308
|
'put',
|
|
311
309
|
body,
|
|
@@ -27,7 +27,7 @@ export class VeSyncWallSwitch extends VeSyncSwitch {
|
|
|
27
27
|
method: 'devicedetail'
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const [response] = await
|
|
30
|
+
const [response] = await this.callApi(
|
|
31
31
|
'/inwallswitch/v1/device/devicedetail',
|
|
32
32
|
'post',
|
|
33
33
|
body,
|
|
@@ -56,7 +56,7 @@ export class VeSyncWallSwitch extends VeSyncSwitch {
|
|
|
56
56
|
uuid: this.cid
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
const [response] = await
|
|
59
|
+
const [response] = await this.callApi(
|
|
60
60
|
'/inwallswitch/v1/device/configurations',
|
|
61
61
|
'post',
|
|
62
62
|
body,
|
|
@@ -82,7 +82,7 @@ export class VeSyncWallSwitch extends VeSyncSwitch {
|
|
|
82
82
|
uuid: this.cid
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
const [response] = await
|
|
85
|
+
const [response] = await this.callApi(
|
|
86
86
|
'/inwallswitch/v1/device/devicestatus',
|
|
87
87
|
'put',
|
|
88
88
|
body,
|
|
@@ -109,7 +109,7 @@ export class VeSyncWallSwitch extends VeSyncSwitch {
|
|
|
109
109
|
uuid: this.cid
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
-
const [response] = await
|
|
112
|
+
const [response] = await this.callApi(
|
|
113
113
|
'/inwallswitch/v1/device/devicestatus',
|
|
114
114
|
'put',
|
|
115
115
|
body,
|
|
@@ -151,7 +151,7 @@ export class VeSyncDimmerSwitch extends VeSyncSwitch {
|
|
|
151
151
|
method: 'devicedetail'
|
|
152
152
|
};
|
|
153
153
|
|
|
154
|
-
const [response] = await
|
|
154
|
+
const [response] = await this.callApi(
|
|
155
155
|
'/dimmer/v1/device/devicedetail',
|
|
156
156
|
'post',
|
|
157
157
|
body,
|
|
@@ -190,7 +190,7 @@ export class VeSyncDimmerSwitch extends VeSyncSwitch {
|
|
|
190
190
|
uuid: this.cid
|
|
191
191
|
};
|
|
192
192
|
|
|
193
|
-
const [response] = await
|
|
193
|
+
const [response] = await this.callApi(
|
|
194
194
|
'/dimmer/v1/device/configurations',
|
|
195
195
|
'post',
|
|
196
196
|
body,
|
|
@@ -216,7 +216,7 @@ export class VeSyncDimmerSwitch extends VeSyncSwitch {
|
|
|
216
216
|
uuid: this.cid
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
const [response] = await
|
|
219
|
+
const [response] = await this.callApi(
|
|
220
220
|
'/dimmer/v1/device/devicestatus',
|
|
221
221
|
'put',
|
|
222
222
|
body,
|
|
@@ -243,7 +243,7 @@ export class VeSyncDimmerSwitch extends VeSyncSwitch {
|
|
|
243
243
|
uuid: this.cid
|
|
244
244
|
};
|
|
245
245
|
|
|
246
|
-
const [response] = await
|
|
246
|
+
const [response] = await this.callApi(
|
|
247
247
|
'/dimmer/v1/device/devicestatus',
|
|
248
248
|
'put',
|
|
249
249
|
body,
|
|
@@ -275,7 +275,7 @@ export class VeSyncDimmerSwitch extends VeSyncSwitch {
|
|
|
275
275
|
uuid: this.cid
|
|
276
276
|
};
|
|
277
277
|
|
|
278
|
-
const [response] = await
|
|
278
|
+
const [response] = await this.callApi(
|
|
279
279
|
'/dimmer/v1/device/updatebrightness',
|
|
280
280
|
'put',
|
|
281
281
|
body,
|
|
@@ -307,7 +307,7 @@ export class VeSyncDimmerSwitch extends VeSyncSwitch {
|
|
|
307
307
|
uuid: this.cid
|
|
308
308
|
};
|
|
309
309
|
|
|
310
|
-
const [response] = await
|
|
310
|
+
const [response] = await this.callApi(
|
|
311
311
|
'/dimmer/v1/device/devicergbstatus',
|
|
312
312
|
'put',
|
|
313
313
|
body,
|
|
@@ -335,7 +335,7 @@ export class VeSyncDimmerSwitch extends VeSyncSwitch {
|
|
|
335
335
|
uuid: this.cid
|
|
336
336
|
};
|
|
337
337
|
|
|
338
|
-
const [response] = await
|
|
338
|
+
const [response] = await this.callApi(
|
|
339
339
|
'/dimmer/v1/device/devicergbstatus',
|
|
340
340
|
'put',
|
|
341
341
|
body,
|
|
@@ -362,7 +362,7 @@ export class VeSyncDimmerSwitch extends VeSyncSwitch {
|
|
|
362
362
|
status: 'on'
|
|
363
363
|
};
|
|
364
364
|
|
|
365
|
-
const [response] = await
|
|
365
|
+
const [response] = await this.callApi(
|
|
366
366
|
'/dimmer/v1/device/devicergbstatus',
|
|
367
367
|
'put',
|
|
368
368
|
body,
|
|
@@ -389,7 +389,7 @@ export class VeSyncDimmerSwitch extends VeSyncSwitch {
|
|
|
389
389
|
status: 'on'
|
|
390
390
|
};
|
|
391
391
|
|
|
392
|
-
const [response] = await
|
|
392
|
+
const [response] = await this.callApi(
|
|
393
393
|
'/dimmer/v1/device/indicatorlightstatus',
|
|
394
394
|
'put',
|
|
395
395
|
body,
|
|
@@ -416,7 +416,7 @@ export class VeSyncDimmerSwitch extends VeSyncSwitch {
|
|
|
416
416
|
status: 'off'
|
|
417
417
|
};
|
|
418
418
|
|
|
419
|
-
const [response] = await
|
|
419
|
+
const [response] = await this.callApi(
|
|
420
420
|
'/dimmer/v1/device/indicatorlightstatus',
|
|
421
421
|
'put',
|
|
422
422
|
body,
|