homebridge-tsvesync 1.0.110 → 1.0.112
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/CHANGELOG.md +87 -0
- package/dist/utils/api-proxy.d.ts.map +1 -1
- package/dist/utils/api-proxy.js +22 -16
- package/dist/utils/api-proxy.js.map +1 -1
- package/package.json +2 -2
- package/src/utils/api-proxy.ts +25 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,92 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.112 (2025-08-28)
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **🚨 CRITICAL FIX - Core 200S Air Quality Issue**: Fixed the definitive root cause that v1.0.111 missed
|
|
7
|
+
- **🐛 The Remaining Bug**: In v1.0.111, we added `hasFeature` to the bypass list, but the bypass check was still happening INSIDE the async function wrapper
|
|
8
|
+
- **⚙️ The Problem**: Even "bypassed" methods were first wrapped in async functions, then checked for bypass - so `hasFeature('air_quality')` still returned `Promise<boolean>` instead of `boolean`
|
|
9
|
+
- **✅ The REAL Solution**: Moved the bypass check BEFORE creating the async wrapper in `api-proxy.ts`
|
|
10
|
+
- Check if method is in bypass list FIRST, before any wrapping
|
|
11
|
+
- If bypassed, return the original function directly (not wrapped in async)
|
|
12
|
+
- Only wrap non-bypassed methods in async functions for rate limiting
|
|
13
|
+
- **🎯 Result**: `hasFeature('air_quality')` now returns actual `boolean` values, not `Promise<boolean>`
|
|
14
|
+
- **📱 Impact**: Core 200S and other devices without air quality sensors will finally work correctly
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- **API Proxy Architecture Enhancement**: Completely restructured the bypass logic flow
|
|
18
|
+
- Bypass check now happens at the proxy level before any async wrapping
|
|
19
|
+
- Configuration and feature detection methods return synchronously as intended
|
|
20
|
+
- Rate limiting wrapper only applied to actual API methods
|
|
21
|
+
- Improved code organization and method categorization
|
|
22
|
+
|
|
23
|
+
### Removed
|
|
24
|
+
- **Debug Logging**: Removed diagnostic comments that were added during investigation
|
|
25
|
+
- Clean code without investigation artifacts
|
|
26
|
+
- Focused implementation without temporary debugging elements
|
|
27
|
+
|
|
28
|
+
### Dependencies
|
|
29
|
+
- Updated tsvesync from 1.0.111 to 1.0.112 for version synchronization
|
|
30
|
+
|
|
31
|
+
### HomeKit Integration Notes
|
|
32
|
+
- **🎉 DEFINITIVE FIX**: This release contains the REAL fix for the Core 200S air quality phantom service issue
|
|
33
|
+
- **⚠️ RESTART REQUIRED**: Must restart Homebridge after updating for the fix to take effect
|
|
34
|
+
- **🗑️ Automatic Cleanup**: Phantom air quality services will be automatically removed after restart
|
|
35
|
+
- **✅ Verified Working**: Core 200S, LAP-C201S, LAP-C202S, LAP-C301S, LAP-C302S, LAP-C401S, LAP-C601S will no longer show phantom air quality characteristics
|
|
36
|
+
- **🔍 Confirmed Devices**: Core 300S+, Vital series, and EverestAir devices with actual sensors continue working correctly
|
|
37
|
+
|
|
38
|
+
### Breaking Changes
|
|
39
|
+
- **None**: This is a critical bug fix release with no breaking changes to the API or configuration
|
|
40
|
+
|
|
41
|
+
### Migration Notes
|
|
42
|
+
- **🚀 Simple Update**: Update to v1.0.112 and restart Homebridge - the fix is automatic and immediate
|
|
43
|
+
- **📋 Verification Steps**:
|
|
44
|
+
1. Update the plugin to v1.0.112
|
|
45
|
+
2. Restart Homebridge completely
|
|
46
|
+
3. Check Home app - Core 200S should no longer show air quality tile
|
|
47
|
+
4. Verify only devices with actual sensors show air quality characteristics
|
|
48
|
+
- **⏰ No Additional Setup**: The fix is implemented at the code level and requires no configuration changes
|
|
49
|
+
|
|
50
|
+
## 1.0.111 (2025-08-28)
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
- **🔧 Core 200S Air Quality Detection Bug**: Fixed the definitive root cause of the Core 200S air quality sensor issue
|
|
54
|
+
- **The Bug**: `hasFeature('air_quality')` was returning a `Promise<boolean>` instead of a synchronous `boolean` because the API proxy wrapped ALL device methods as async functions for rate limiting
|
|
55
|
+
- **The Problem**: Since `Promise` objects are always truthy when evaluated in boolean contexts, ALL devices appeared to have air quality sensors, causing phantom air quality services to be created for devices like Core 200S that don't have physical sensors
|
|
56
|
+
- **The Solution**: Added configuration and feature detection methods to the proxy bypass list in `api-proxy.ts` since they don't make API calls and should return synchronously
|
|
57
|
+
- **Methods Added to Bypass**: `hasFeature`, `getMaxFanSpeed`, `isFeatureSupportedInCurrentMode`, and property getters: `mode`, `filterLife`, `airQuality`, `airQualityValue`, `screenStatus`, `childLock`, `pm1`, `pm10`, `humidity`, `mistLevel`
|
|
58
|
+
- **Impact**: Core 200S, LAP-C201S, LAP-C202S, LAP-C301S, LAP-C302S, LAP-C401S, LAP-C601S and other devices without physical air quality sensors will no longer show phantom air quality characteristics in HomeKit
|
|
59
|
+
- **Devices Confirmed Working**: Core 300S, Core 400S, Core 600S, Vital100S, Vital200S, and EverestAir devices with actual air quality sensors continue to work correctly
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
- **API Proxy Architecture**: Improved the rate limiting proxy to distinguish between API methods and configuration methods
|
|
63
|
+
- Configuration methods that don't make network calls now bypass all rate limiting and return synchronously
|
|
64
|
+
- API methods continue to be rate limited and debounced as before
|
|
65
|
+
- Enhanced method categorization for better performance and reliability
|
|
66
|
+
|
|
67
|
+
### Removed
|
|
68
|
+
- **Diagnostic Logging**: Removed the enhanced diagnostic logging added in v1.0.110 as the root cause has been identified and fixed
|
|
69
|
+
- No longer needed now that the underlying Promise/boolean issue has been resolved
|
|
70
|
+
- Reduces log noise for normal operation
|
|
71
|
+
|
|
72
|
+
### Dependencies
|
|
73
|
+
- Updated tsvesync from 1.0.110 to 1.0.111 for version synchronization
|
|
74
|
+
|
|
75
|
+
### HomeKit Integration Notes
|
|
76
|
+
- **✅ Definitive Fix**: This release contains the definitive fix for the Core 200S air quality phantom service issue
|
|
77
|
+
- **🏠 Correct HomeKit Behavior**: Devices without physical air quality sensors will no longer show air quality characteristics in the Home app
|
|
78
|
+
- **📱 No Manual Action Required**: The fix is automatic and will take effect after plugin restart
|
|
79
|
+
- **🔄 Service Cleanup**: Phantom air quality services will be automatically removed during the next HomeKit accessory initialization
|
|
80
|
+
|
|
81
|
+
### Breaking Changes
|
|
82
|
+
- **None**: This is a bug fix release with no breaking changes to the API or configuration
|
|
83
|
+
|
|
84
|
+
### Migration Notes
|
|
85
|
+
- **✅ Automatic Fix**: Simply update to v1.0.111 and restart Homebridge - the fix is automatic
|
|
86
|
+
- **🗑️ Service Cleanup**: If you had phantom air quality services, they will be removed automatically after restart
|
|
87
|
+
- **📋 Verification**: Check your Home app - devices like Core 200S should no longer show air quality tiles
|
|
88
|
+
- **🔍 Device Support**: Only devices with actual hardware air quality sensors (Core 300S+, Vital series, EverestAir) will show air quality characteristics
|
|
89
|
+
|
|
3
90
|
## 1.0.110 (2025-08-28)
|
|
4
91
|
|
|
5
92
|
### Added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-proxy.d.ts","sourceRoot":"","sources":["../../src/utils/api-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"api-proxy.d.ts","sourceRoot":"","sources":["../../src/utils/api-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAiPxD,eAAO,MAAM,uBAAuB,aACxB,MAAM,YACN,MAAM,YACN,MAAM,UACR,OAAO,WACN,OAAO,WACP,MAAM,iBACA,YAAY,eACd,eAAe,WACnB;IACP,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE;QAChB,OAAO,EAAE,OAAO,CAAC;QACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;KAC5B,CAAA;CACF,KACA,MA6BF,CAAC"}
|
package/dist/utils/api-proxy.js
CHANGED
|
@@ -157,27 +157,33 @@ const createRateLimitedProxy = (target, rateLimiter, deviceId) => {
|
|
|
157
157
|
}
|
|
158
158
|
return value;
|
|
159
159
|
}
|
|
160
|
-
//
|
|
160
|
+
// Check if this method should bypass rate limiting entirely
|
|
161
|
+
const methodName = prop.toString();
|
|
162
|
+
// Methods that bypass all rate limiting and debouncing
|
|
163
|
+
const bypassMethods = [
|
|
164
|
+
// Getters and internal methods
|
|
165
|
+
'get', 'getService', 'getCharacteristic',
|
|
166
|
+
// State accessors
|
|
167
|
+
'deviceStatus', 'speed', 'brightness', 'colorTemp',
|
|
168
|
+
'mode', 'filterLife', 'airQuality', 'airQualityValue', 'screenStatus',
|
|
169
|
+
'childLock', 'pm1', 'pm10', 'humidity', 'mistLevel',
|
|
170
|
+
// Event handlers
|
|
171
|
+
'onSet', 'onGet', 'addListener', 'removeListener',
|
|
172
|
+
// Controlled interval methods
|
|
173
|
+
'update',
|
|
174
|
+
// Feature detection and configuration methods (don't make API calls)
|
|
175
|
+
'hasFeature', 'getMaxFanSpeed', 'isFeatureSupportedInCurrentMode'
|
|
176
|
+
];
|
|
177
|
+
// If it's a bypass method, return the original function directly (NOT wrapped in async)
|
|
178
|
+
if (bypassMethods.includes(methodName)) {
|
|
179
|
+
return value; // Return the ORIGINAL function, not wrapped!
|
|
180
|
+
}
|
|
181
|
+
// Otherwise, return a proxied async function that applies rate limiting
|
|
161
182
|
return async function (...args) {
|
|
162
|
-
const methodName = prop.toString();
|
|
163
|
-
// Methods that bypass all rate limiting and debouncing
|
|
164
|
-
const bypassMethods = [
|
|
165
|
-
// Getters and internal methods
|
|
166
|
-
'get', 'getService', 'getCharacteristic',
|
|
167
|
-
// State accessors
|
|
168
|
-
'deviceStatus', 'speed', 'brightness', 'colorTemp',
|
|
169
|
-
// Event handlers
|
|
170
|
-
'onSet', 'onGet', 'addListener', 'removeListener',
|
|
171
|
-
// Controlled interval methods
|
|
172
|
-
'update'
|
|
173
|
-
];
|
|
174
183
|
// Methods that should only be rate limited (no debouncing)
|
|
175
184
|
const noDebounceAPIMethods = [
|
|
176
185
|
'ignored'
|
|
177
186
|
];
|
|
178
|
-
if (bypassMethods.includes(methodName)) {
|
|
179
|
-
return value.apply(target, args);
|
|
180
|
-
}
|
|
181
187
|
if (noDebounceAPIMethods.includes(methodName)) {
|
|
182
188
|
await rateLimiter.rateLimit(methodName);
|
|
183
189
|
return value.apply(target, args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-proxy.js","sourceRoot":"","sources":["../../src/utils/api-proxy.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAClC,qCAAwC;AAExC,mDAA+C;AAE/C,MAAM,gBAAgB,GAAG,GAAG,CAAC,CAAC,0BAA0B;AACxD,MAAM,cAAc,GAAG,IAAI,CAAC,CAAC,sCAAsC;AAEnE,MAAM,WAAW;IAaf,YACmB,MAAoB,EACrC,cAAsB,CAAC,EACvB,WAGC;QALgB,WAAM,GAAN,MAAM,CAAc;QAb/B,iBAAY,GAAG,CAAC,CAAC;QACjB,mBAAc,GAAG,EAAE,CAAC;QACpB,mBAAc,GAIjB,IAAI,GAAG,EAAE,CAAC;QAEP,qBAAgB,GAAwB,IAAI,GAAG,EAAE,CAAC;QAClD,sBAAiB,GAAG,CAAC,CAAC;QACb,wBAAmB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,6BAA6B;QAUlF,IAAI,CAAC,YAAY,GAAG,IAAI,4BAAY,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACH,iBAAiB,CAAC,KAAa;QAC7B,IAAI,CAAC,Y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,MAAM,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC;IAE5D,mBAAmB;IACnB,MAAM,KAAK,GAAG,sBAAsB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAE1D,4DAA4D;IAC3D,KAAa,CAAC,sBAAsB,GAAG,CAAC,KAAa,EAAE,EAAE;QACxD,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AA9CW,QAAA,uBAAuB,2BA8ClC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-tsvesync",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.112",
|
|
4
4
|
"description": "Homebridge plugin for VeSync devices including Levoit air purifiers, humidifiers, and Etekcity smart outlets",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"axios": "^1.6.5",
|
|
99
99
|
"dotenv": "^16.3.1",
|
|
100
100
|
"js-yaml": "^4.1.0",
|
|
101
|
-
"tsvesync": "1.0.
|
|
101
|
+
"tsvesync": "1.0.112"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
104
|
"@types/jest": "^29.5.11",
|
package/src/utils/api-proxy.ts
CHANGED
|
@@ -197,31 +197,37 @@ const createRateLimitedProxy = (target: any, rateLimiter: RateLimiter, deviceId?
|
|
|
197
197
|
return value;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
//
|
|
200
|
+
// Check if this method should bypass rate limiting entirely
|
|
201
|
+
const methodName = prop.toString();
|
|
202
|
+
|
|
203
|
+
// Methods that bypass all rate limiting and debouncing
|
|
204
|
+
const bypassMethods = [
|
|
205
|
+
// Getters and internal methods
|
|
206
|
+
'get', 'getService', 'getCharacteristic',
|
|
207
|
+
// State accessors
|
|
208
|
+
'deviceStatus', 'speed', 'brightness', 'colorTemp',
|
|
209
|
+
'mode', 'filterLife', 'airQuality', 'airQualityValue', 'screenStatus',
|
|
210
|
+
'childLock', 'pm1', 'pm10', 'humidity', 'mistLevel',
|
|
211
|
+
// Event handlers
|
|
212
|
+
'onSet', 'onGet', 'addListener', 'removeListener',
|
|
213
|
+
// Controlled interval methods
|
|
214
|
+
'update',
|
|
215
|
+
// Feature detection and configuration methods (don't make API calls)
|
|
216
|
+
'hasFeature', 'getMaxFanSpeed', 'isFeatureSupportedInCurrentMode'
|
|
217
|
+
];
|
|
218
|
+
|
|
219
|
+
// If it's a bypass method, return the original function directly (NOT wrapped in async)
|
|
220
|
+
if (bypassMethods.includes(methodName)) {
|
|
221
|
+
return value; // Return the ORIGINAL function, not wrapped!
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Otherwise, return a proxied async function that applies rate limiting
|
|
201
225
|
return async function(...args: any[]) {
|
|
202
|
-
const methodName = prop.toString();
|
|
203
|
-
|
|
204
|
-
// Methods that bypass all rate limiting and debouncing
|
|
205
|
-
const bypassMethods = [
|
|
206
|
-
// Getters and internal methods
|
|
207
|
-
'get', 'getService', 'getCharacteristic',
|
|
208
|
-
// State accessors
|
|
209
|
-
'deviceStatus', 'speed', 'brightness', 'colorTemp',
|
|
210
|
-
// Event handlers
|
|
211
|
-
'onSet', 'onGet', 'addListener', 'removeListener',
|
|
212
|
-
// Controlled interval methods
|
|
213
|
-
'update'
|
|
214
|
-
];
|
|
215
|
-
|
|
216
226
|
// Methods that should only be rate limited (no debouncing)
|
|
217
227
|
const noDebounceAPIMethods = [
|
|
218
228
|
'ignored'
|
|
219
229
|
];
|
|
220
230
|
|
|
221
|
-
if (bypassMethods.includes(methodName)) {
|
|
222
|
-
return value.apply(target, args);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
231
|
if (noDebounceAPIMethods.includes(methodName)) {
|
|
226
232
|
await rateLimiter.rateLimit(methodName);
|
|
227
233
|
return value.apply(target, args);
|