tsvesync 1.0.68 → 1.0.70
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.
|
@@ -34,6 +34,11 @@ export declare class VeSyncHumid200300S extends VeSyncHumidifier {
|
|
|
34
34
|
* Override base class to return target humidity from configuration
|
|
35
35
|
*/
|
|
36
36
|
get humidity(): number;
|
|
37
|
+
/**
|
|
38
|
+
* Get current humidity
|
|
39
|
+
* Provides access to the current humidity reading
|
|
40
|
+
*/
|
|
41
|
+
get currentHumidity(): number;
|
|
37
42
|
/**
|
|
38
43
|
* Get automatic stop configuration
|
|
39
44
|
*/
|
|
@@ -42,6 +47,11 @@ export declare class VeSyncHumid200300S extends VeSyncHumidifier {
|
|
|
42
47
|
* Get night light brightness
|
|
43
48
|
*/
|
|
44
49
|
get nightLightBrightness(): number;
|
|
50
|
+
/**
|
|
51
|
+
* Return JSON details for humidifier
|
|
52
|
+
* Override to include current humidity and target humidity
|
|
53
|
+
*/
|
|
54
|
+
displayJSON(): string;
|
|
45
55
|
/**
|
|
46
56
|
* Set night light brightness
|
|
47
57
|
*/
|
|
@@ -20,7 +20,7 @@ class VeSyncHumid200300S extends humidifier_1.VeSyncHumidifier {
|
|
|
20
20
|
* Get device details
|
|
21
21
|
*/
|
|
22
22
|
async getDetails() {
|
|
23
|
-
var _a, _b, _c;
|
|
23
|
+
var _a, _b, _c, _d;
|
|
24
24
|
logger_1.logger.debug(`Getting details for device: ${this.deviceName}`);
|
|
25
25
|
const [response, status] = await this.callApi('/cloud/v2/deviceManaged/bypassV2', 'post', {
|
|
26
26
|
...helpers_1.Helpers.reqBody(this.manager, 'bypassV2'),
|
|
@@ -40,7 +40,7 @@ class VeSyncHumid200300S extends humidifier_1.VeSyncHumidifier {
|
|
|
40
40
|
this.details = {
|
|
41
41
|
mode: result.mode || '',
|
|
42
42
|
humidity: result.humidity || 0, // Current humidity
|
|
43
|
-
target_humidity: result.
|
|
43
|
+
target_humidity: ((_b = result.configuration) === null || _b === void 0 ? void 0 : _b.auto_target_humidity) || result.target_humidity || 0, // Target humidity from configuration
|
|
44
44
|
mist_level: result.mist_level || 0,
|
|
45
45
|
mist_virtual_level: result.mist_virtual_level || 0,
|
|
46
46
|
water_lacks: result.water_lacks || false,
|
|
@@ -48,8 +48,8 @@ class VeSyncHumid200300S extends humidifier_1.VeSyncHumidifier {
|
|
|
48
48
|
water_tank_lifted: result.water_tank_lifted || false,
|
|
49
49
|
display: result.display || false,
|
|
50
50
|
automatic_stop: result.automatic_stop_reach_target || false,
|
|
51
|
-
automatic_stop_configured: ((
|
|
52
|
-
auto_target_humidity: ((
|
|
51
|
+
automatic_stop_configured: ((_c = result.configuration) === null || _c === void 0 ? void 0 : _c.automatic_stop) || false,
|
|
52
|
+
auto_target_humidity: ((_d = result.configuration) === null || _d === void 0 ? void 0 : _d.auto_target_humidity) || 0,
|
|
53
53
|
configuration: result.configuration || {},
|
|
54
54
|
connection_status: result.connection_status || null,
|
|
55
55
|
night_light_brightness: result.night_light_brightness || 0
|
|
@@ -120,6 +120,13 @@ class VeSyncHumid200300S extends humidifier_1.VeSyncHumidifier {
|
|
|
120
120
|
get humidity() {
|
|
121
121
|
return this.details.auto_target_humidity || 0;
|
|
122
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* Get current humidity
|
|
125
|
+
* Provides access to the current humidity reading
|
|
126
|
+
*/
|
|
127
|
+
get currentHumidity() {
|
|
128
|
+
return this.details.humidity || 0;
|
|
129
|
+
}
|
|
123
130
|
/**
|
|
124
131
|
* Get automatic stop configuration
|
|
125
132
|
*/
|
|
@@ -132,6 +139,21 @@ class VeSyncHumid200300S extends humidifier_1.VeSyncHumidifier {
|
|
|
132
139
|
get nightLightBrightness() {
|
|
133
140
|
return this.details.night_light_brightness || 0;
|
|
134
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Return JSON details for humidifier
|
|
144
|
+
* Override to include current humidity and target humidity
|
|
145
|
+
*/
|
|
146
|
+
displayJSON() {
|
|
147
|
+
var _a, _b, _c;
|
|
148
|
+
const baseInfo = JSON.parse(super.displayJSON());
|
|
149
|
+
// Add current humidity from details
|
|
150
|
+
baseInfo['Humidity'] = ((_a = this.details.humidity) === null || _a === void 0 ? void 0 : _a.toString()) || '0';
|
|
151
|
+
// Add target humidity from configuration
|
|
152
|
+
baseInfo['Target Humidity'] = ((_b = this.details.auto_target_humidity) === null || _b === void 0 ? void 0 : _b.toString()) || '0';
|
|
153
|
+
// Add mist virtual level
|
|
154
|
+
baseInfo['Mist Virtual Level'] = ((_c = this.details.mist_virtual_level) === null || _c === void 0 ? void 0 : _c.toString()) || '0';
|
|
155
|
+
return JSON.stringify(baseInfo, null, 4);
|
|
156
|
+
}
|
|
135
157
|
/**
|
|
136
158
|
* Set night light brightness
|
|
137
159
|
*/
|
|
@@ -384,5 +384,12 @@ class VeSyncHumidifier extends vesyncFan_1.VeSyncFan {
|
|
|
384
384
|
}
|
|
385
385
|
return success;
|
|
386
386
|
}
|
|
387
|
+
/**
|
|
388
|
+
* Get current humidity
|
|
389
|
+
* Provides access to the current humidity reading
|
|
390
|
+
*/
|
|
391
|
+
get currentHumidity() {
|
|
392
|
+
return this.details.humidity || 0;
|
|
393
|
+
}
|
|
387
394
|
}
|
|
388
395
|
exports.VeSyncHumidifier = VeSyncHumidifier;
|
package/package.json
CHANGED
|
@@ -48,7 +48,7 @@ export class VeSyncHumid200300S extends VeSyncHumidifier {
|
|
|
48
48
|
this.details = {
|
|
49
49
|
mode: result.mode || '',
|
|
50
50
|
humidity: result.humidity || 0, // Current humidity
|
|
51
|
-
target_humidity: result.
|
|
51
|
+
target_humidity: result.configuration?.auto_target_humidity || result.target_humidity || 0, // Target humidity from configuration
|
|
52
52
|
mist_level: result.mist_level || 0,
|
|
53
53
|
mist_virtual_level: result.mist_virtual_level || 0,
|
|
54
54
|
water_lacks: result.water_lacks || false,
|
|
@@ -140,6 +140,14 @@ export class VeSyncHumid200300S extends VeSyncHumidifier {
|
|
|
140
140
|
return this.details.auto_target_humidity || 0;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Get current humidity
|
|
145
|
+
* Provides access to the current humidity reading
|
|
146
|
+
*/
|
|
147
|
+
get currentHumidity(): number {
|
|
148
|
+
return this.details.humidity || 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
143
151
|
/**
|
|
144
152
|
* Get automatic stop configuration
|
|
145
153
|
*/
|
|
@@ -154,6 +162,25 @@ export class VeSyncHumid200300S extends VeSyncHumidifier {
|
|
|
154
162
|
return this.details.night_light_brightness || 0;
|
|
155
163
|
}
|
|
156
164
|
|
|
165
|
+
/**
|
|
166
|
+
* Return JSON details for humidifier
|
|
167
|
+
* Override to include current humidity and target humidity
|
|
168
|
+
*/
|
|
169
|
+
displayJSON(): string {
|
|
170
|
+
const baseInfo = JSON.parse(super.displayJSON());
|
|
171
|
+
|
|
172
|
+
// Add current humidity from details
|
|
173
|
+
baseInfo['Humidity'] = this.details.humidity?.toString() || '0';
|
|
174
|
+
|
|
175
|
+
// Add target humidity from configuration
|
|
176
|
+
baseInfo['Target Humidity'] = this.details.auto_target_humidity?.toString() || '0';
|
|
177
|
+
|
|
178
|
+
// Add mist virtual level
|
|
179
|
+
baseInfo['Mist Virtual Level'] = this.details.mist_virtual_level?.toString() || '0';
|
|
180
|
+
|
|
181
|
+
return JSON.stringify(baseInfo, null, 4);
|
|
182
|
+
}
|
|
183
|
+
|
|
157
184
|
/**
|
|
158
185
|
* Set night light brightness
|
|
159
186
|
*/
|
|
@@ -467,4 +467,12 @@ export class VeSyncHumidifier extends VeSyncFan {
|
|
|
467
467
|
}
|
|
468
468
|
return success;
|
|
469
469
|
}
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Get current humidity
|
|
473
|
+
* Provides access to the current humidity reading
|
|
474
|
+
*/
|
|
475
|
+
get currentHumidity(): number {
|
|
476
|
+
return this.details.humidity || 0;
|
|
477
|
+
}
|
|
470
478
|
}
|