tsvesync 1.0.82 → 1.0.84
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/lib/fans/air131.js +11 -9
- package/package.json +2 -2
- package/src/lib/fans/air131.ts +13 -8
package/dist/lib/fans/air131.js
CHANGED
|
@@ -19,7 +19,6 @@ class VeSyncAir131 extends vesyncFan_1.VeSyncFan {
|
|
|
19
19
|
* Get device details
|
|
20
20
|
*/
|
|
21
21
|
async getDetails() {
|
|
22
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
23
22
|
logger_1.logger.debug(`Getting details for device: ${this.deviceName}`);
|
|
24
23
|
const [response, status] = await this.callApi('/131airPurifier/v1/device/deviceDetail', 'post', {
|
|
25
24
|
acceptLanguage: 'en',
|
|
@@ -43,16 +42,19 @@ class VeSyncAir131 extends vesyncFan_1.VeSyncFan {
|
|
|
43
42
|
});
|
|
44
43
|
const success = this.checkResponse([response, status], 'getDetails');
|
|
45
44
|
if (success && response) {
|
|
46
|
-
|
|
45
|
+
// Check if data is in response.result or directly in response
|
|
46
|
+
const data = response.result || response;
|
|
47
|
+
this.deviceStatus = data.deviceStatus === 'on' ? 'on' : 'off';
|
|
47
48
|
this.details = {
|
|
48
|
-
mode:
|
|
49
|
-
speed:
|
|
50
|
-
filterLife:
|
|
51
|
-
screenStatus:
|
|
52
|
-
childLock:
|
|
53
|
-
airQuality:
|
|
54
|
-
active_time:
|
|
49
|
+
mode: data.mode || 'manual', // Default to manual if not specified
|
|
50
|
+
speed: data.level || 0,
|
|
51
|
+
filterLife: data.filterLife || 0,
|
|
52
|
+
screenStatus: data.screenStatus || 'off',
|
|
53
|
+
childLock: data.childLock || false,
|
|
54
|
+
airQuality: data.airQuality || 'unknown',
|
|
55
|
+
active_time: data.activeTime || 0
|
|
55
56
|
};
|
|
57
|
+
logger_1.logger.debug(`${this.deviceName}: Updated details - mode: ${this.details.mode}, speed: ${this.details.speed}, status: ${this.deviceStatus}`);
|
|
56
58
|
return true;
|
|
57
59
|
}
|
|
58
60
|
// Log additional details on failure
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsvesync",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.84",
|
|
4
4
|
"description": "A TypeScript library for interacting with VeSync smart home devices",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/mickgiles/tsvesync#readme",
|
|
34
34
|
"engines": {
|
|
35
|
-
"node": "
|
|
35
|
+
"node": "^18.20.4 || ^20.15.1 || ^22"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"axios": "^1.7.9",
|
package/src/lib/fans/air131.ts
CHANGED
|
@@ -51,16 +51,21 @@ export class VeSyncAir131 extends VeSyncFan {
|
|
|
51
51
|
|
|
52
52
|
const success = this.checkResponse([response, status], 'getDetails');
|
|
53
53
|
if (success && response) {
|
|
54
|
-
|
|
54
|
+
// Check if data is in response.result or directly in response
|
|
55
|
+
const data = response.result || response;
|
|
56
|
+
|
|
57
|
+
this.deviceStatus = data.deviceStatus === 'on' ? 'on' : 'off';
|
|
55
58
|
this.details = {
|
|
56
|
-
mode:
|
|
57
|
-
speed:
|
|
58
|
-
filterLife:
|
|
59
|
-
screenStatus:
|
|
60
|
-
childLock:
|
|
61
|
-
airQuality:
|
|
62
|
-
active_time:
|
|
59
|
+
mode: data.mode || 'manual', // Default to manual if not specified
|
|
60
|
+
speed: data.level || 0,
|
|
61
|
+
filterLife: data.filterLife || 0,
|
|
62
|
+
screenStatus: data.screenStatus || 'off',
|
|
63
|
+
childLock: data.childLock || false,
|
|
64
|
+
airQuality: data.airQuality || 'unknown',
|
|
65
|
+
active_time: data.activeTime || 0
|
|
63
66
|
};
|
|
67
|
+
|
|
68
|
+
logger.debug(`${this.deviceName}: Updated details - mode: ${this.details.mode}, speed: ${this.details.speed}, status: ${this.deviceStatus}`);
|
|
64
69
|
return true;
|
|
65
70
|
}
|
|
66
71
|
|