@lumiastream/tapo-cove 3.0.15 → 3.0.16
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/dist/index.d.ts +1 -0
- package/dist/index.js +24 -10
- package/dist/index.mjs +24 -10
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -386,6 +386,7 @@ var TapoApi = class {
|
|
|
386
386
|
});
|
|
387
387
|
// Change state using lightstate
|
|
388
388
|
this.sendState = (config) => {
|
|
389
|
+
var _a;
|
|
389
390
|
const deviceKey = this._devices.get(config.device.id);
|
|
390
391
|
let shouldWait = false;
|
|
391
392
|
if (config.fetchConfig && config.fetchConfig.shouldWait) {
|
|
@@ -407,17 +408,30 @@ var TapoApi = class {
|
|
|
407
408
|
request: encryptedRequest
|
|
408
409
|
}
|
|
409
410
|
};
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
411
|
+
if ((_a = config.fetchConfig) == null ? void 0 : _a.useAxios) {
|
|
412
|
+
return (0, import_axios2.default)({
|
|
413
|
+
url: `http://${deviceKey.deviceIp}/app?token=${deviceKey.token}`,
|
|
414
|
+
data: {
|
|
415
|
+
method: "POST",
|
|
416
|
+
body: securePassthroughRequest,
|
|
417
|
+
headers: {
|
|
418
|
+
Cookie: deviceKey.sessionCookie
|
|
419
|
+
}
|
|
417
420
|
}
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
+
});
|
|
422
|
+
} else {
|
|
423
|
+
return (0, import_fetch_cove.fetchWork)({
|
|
424
|
+
url: `http://${deviceKey.deviceIp}/app?token=${deviceKey.token}`,
|
|
425
|
+
data: {
|
|
426
|
+
method: "POST",
|
|
427
|
+
body: securePassthroughRequest,
|
|
428
|
+
headers: {
|
|
429
|
+
Cookie: deviceKey.sessionCookie
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
shouldWait
|
|
433
|
+
});
|
|
434
|
+
}
|
|
421
435
|
};
|
|
422
436
|
this.sendPower = (config) => {
|
|
423
437
|
this.sendState({ device: config.device, state: new LightState({ on: config.power }) });
|
package/dist/index.mjs
CHANGED
|
@@ -354,6 +354,7 @@ var TapoApi = class {
|
|
|
354
354
|
});
|
|
355
355
|
// Change state using lightstate
|
|
356
356
|
this.sendState = (config) => {
|
|
357
|
+
var _a;
|
|
357
358
|
const deviceKey = this._devices.get(config.device.id);
|
|
358
359
|
let shouldWait = false;
|
|
359
360
|
if (config.fetchConfig && config.fetchConfig.shouldWait) {
|
|
@@ -375,17 +376,30 @@ var TapoApi = class {
|
|
|
375
376
|
request: encryptedRequest
|
|
376
377
|
}
|
|
377
378
|
};
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
379
|
+
if ((_a = config.fetchConfig) == null ? void 0 : _a.useAxios) {
|
|
380
|
+
return axios2({
|
|
381
|
+
url: `http://${deviceKey.deviceIp}/app?token=${deviceKey.token}`,
|
|
382
|
+
data: {
|
|
383
|
+
method: "POST",
|
|
384
|
+
body: securePassthroughRequest,
|
|
385
|
+
headers: {
|
|
386
|
+
Cookie: deviceKey.sessionCookie
|
|
387
|
+
}
|
|
385
388
|
}
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
+
});
|
|
390
|
+
} else {
|
|
391
|
+
return fetchWork({
|
|
392
|
+
url: `http://${deviceKey.deviceIp}/app?token=${deviceKey.token}`,
|
|
393
|
+
data: {
|
|
394
|
+
method: "POST",
|
|
395
|
+
body: securePassthroughRequest,
|
|
396
|
+
headers: {
|
|
397
|
+
Cookie: deviceKey.sessionCookie
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
shouldWait
|
|
401
|
+
});
|
|
402
|
+
}
|
|
389
403
|
};
|
|
390
404
|
this.sendPower = (config) => {
|
|
391
405
|
this.sendState({ device: config.device, state: new LightState({ on: config.power }) });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumiastream/tapo-cove",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.16",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "GPL",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"tsup": "*",
|
|
24
24
|
"typescript": "*"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "eca53cb985b927ddc7e3c886fd2be02e0f2b4bdb"
|
|
27
27
|
}
|