homebridge-tsvesync 1.4.7 โ 1.4.9
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/AGENTS.md +31 -0
- package/CHANGELOG.md +27 -0
- package/dist/accessories/humidifier.accessory.d.ts +22 -0
- package/dist/accessories/humidifier.accessory.d.ts.map +1 -1
- package/dist/accessories/humidifier.accessory.js +163 -219
- package/dist/accessories/humidifier.accessory.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/accessories/humidifier-write-consistency.test.ts +516 -0
- package/src/accessories/humidifier.accessory.ts +219 -313
- package/tsconfig.json +2 -1
- package/dist/__tests__/setup.d.ts +0 -10
- package/dist/__tests__/setup.d.ts.map +0 -1
- package/dist/__tests__/setup.js +0 -82
- package/dist/__tests__/setup.js.map +0 -1
- package/dist/__tests__/utils/test-helpers.d.ts +0 -279
- package/dist/__tests__/utils/test-helpers.d.ts.map +0 -1
- package/dist/__tests__/utils/test-helpers.js +0 -831
- package/dist/__tests__/utils/test-helpers.js.map +0 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Homebridge TSVeSync Agent Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
- `homebridge-tsvesync` is the Homebridge/HomeKit layer on top of `tsvesync`.
|
|
5
|
+
- Source of truth is `src/`; `dist/` is generated output and should not be edited directly.
|
|
6
|
+
- Device capability changes should usually be validated in `tsvesync` first, then surfaced here through accessory/service mapping.
|
|
7
|
+
|
|
8
|
+
## Where To Look
|
|
9
|
+
- `package.json`: plugin metadata, version, scripts
|
|
10
|
+
- `src/platform.ts`: platform lifecycle and accessory registration
|
|
11
|
+
- `src/accessories/*.ts`: HomeKit service/characteristic mappings
|
|
12
|
+
- `src/utils/device-factory.ts`: model-to-accessory routing
|
|
13
|
+
- `src/types/*.ts`: device and library typing glue
|
|
14
|
+
- `src/settings.ts`: plugin configuration
|
|
15
|
+
- `src/__tests__/**`: Jest coverage for platform, accessories, and device behaviors
|
|
16
|
+
|
|
17
|
+
## Working Rules
|
|
18
|
+
- Never edit `dist/` by hand.
|
|
19
|
+
- Keep package version aligned with `tsvesync`.
|
|
20
|
+
- If a feature does not exist correctly in `tsvesync`, fix or model it there before papering over it in Homebridge.
|
|
21
|
+
- HomeKit responsiveness matters: characteristic updates, service choice, and accessory categories should match Home app behavior, not just compile.
|
|
22
|
+
- When adding a new feature or device, update the accessory mapping, device factory, types, and tests together.
|
|
23
|
+
|
|
24
|
+
## Validation
|
|
25
|
+
- Run `npm run build`.
|
|
26
|
+
- Run `npm test` for behavior changes.
|
|
27
|
+
- For HomeKit-specific issues, inspect the exact accessory/service mapping and use targeted tests rather than broad guesswork.
|
|
28
|
+
|
|
29
|
+
## Release Notes
|
|
30
|
+
- This repo normally ships with `tsvesync` on the same version.
|
|
31
|
+
- Coordinate changelog and release prep across both repos.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.4.9 (2026-03-30)
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **๐ง Dual 200S Mode, Mist, and Humidity Control**: Corrected HomeKit target-state mapping for Dual 200S / LUH-D301S humidifiers, constrained mist control to the two supported levels, and switches to manual mode before applying mist-speed changes so Home commands match actual device behavior.
|
|
7
|
+
- **๐ฏ Humidity Slider Stability**: Prevented target-humidity snap-back by keeping the commanded humidity in memory, updating the humidity field the getter actually reads, and syncing `Active` immediately when humidity changes power the unit on.
|
|
8
|
+
- **๐ Stale Mode Override Expiry**: Expires the temporary commanded-mode override after 30 seconds so HomeKit stays stable during eventual consistency without masking later mode changes from the VeSync app.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **๐งฑ Build Scope**: Excluded test files from the production TypeScript build to avoid type-check failures caused by local/Homebridge test-only type differences.
|
|
12
|
+
|
|
13
|
+
### Tests
|
|
14
|
+
- **๐งช Dual 200S Regression Coverage**: Expanded humidifier write-consistency coverage around target humidity and stale-response behavior so the plugin-side Dual 200S fixes stay locked in.
|
|
15
|
+
|
|
16
|
+
### Dependencies
|
|
17
|
+
- **๐ฆ tsvesync**: Updated to 1.4.9 for the Dual 200S humidifier bypass write-method fix.
|
|
18
|
+
|
|
19
|
+
## 1.4.8 (2026-03-27)
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- **๐ง Dual 200S Write Consistency**: Humidifier writes now follow the same optimistic HomeKit update pattern as the air purifier accessory, so successful power and auto-mode commands no longer log false "did not change to desired state/mode" warnings or bounce the Home app back to stale values while VeSync catches up.
|
|
23
|
+
|
|
24
|
+
### Tests
|
|
25
|
+
- **๐งช Humidifier Regression Coverage**: Added targeted stale-refresh tests for Dual 200S power and auto-mode writes to lock in the eventual-consistency behavior reported in issue #31.
|
|
26
|
+
|
|
27
|
+
### Dependencies
|
|
28
|
+
- **๐ฆ tsvesync**: Updated to 1.4.8 for version sync (no functional changes).
|
|
29
|
+
|
|
3
30
|
## 1.4.7 (2026-02-02)
|
|
4
31
|
|
|
5
32
|
### Fixed
|
|
@@ -5,6 +5,7 @@ import { DeviceCapabilities, VeSyncHumidifier } from '../types/device.types';
|
|
|
5
5
|
export declare class HumidifierAccessory extends BaseAccessory {
|
|
6
6
|
protected readonly device: VeSyncHumidifier;
|
|
7
7
|
private capabilities;
|
|
8
|
+
private isHumidDual200S;
|
|
8
9
|
private isHumid200S;
|
|
9
10
|
private isHumid200300S;
|
|
10
11
|
private isHumid1000S;
|
|
@@ -12,7 +13,13 @@ export declare class HumidifierAccessory extends BaseAccessory {
|
|
|
12
13
|
private lightService?;
|
|
13
14
|
private temperatureService?;
|
|
14
15
|
private filterService?;
|
|
16
|
+
private _lastCommandedMode;
|
|
17
|
+
private _lastCommandedModeTime;
|
|
15
18
|
constructor(platform: TSVESyncPlatform, accessory: PlatformAccessory, device: VeSyncHumidifier);
|
|
19
|
+
/**
|
|
20
|
+
* Detect if the device is a HumidDual200S (or regional variant LUH-D301S)
|
|
21
|
+
*/
|
|
22
|
+
private detectHumidDual200S;
|
|
16
23
|
/**
|
|
17
24
|
* Detect if the device is a Humid200S
|
|
18
25
|
*/
|
|
@@ -29,6 +36,20 @@ export declare class HumidifierAccessory extends BaseAccessory {
|
|
|
29
36
|
* Detect if the device is a Superior6000S
|
|
30
37
|
*/
|
|
31
38
|
private detectSuperior6000S;
|
|
39
|
+
/**
|
|
40
|
+
* Convert a VeSync mode string to a HomeKit TargetHumidifierDehumidifierState value.
|
|
41
|
+
*
|
|
42
|
+
* For Dual200S the mapping is swapped so that VeSync "auto" (which needs a
|
|
43
|
+
* humidity target) lands on HomeKit state 1 (HUMIDIFIER / "Humidity" in the
|
|
44
|
+
* Home app) where Apple shows the humidity slider, and VeSync "manual"
|
|
45
|
+
* (fixed mist, no target) lands on state 0 ("Auto", no slider).
|
|
46
|
+
*/
|
|
47
|
+
private modeToTargetState;
|
|
48
|
+
/**
|
|
49
|
+
* Convert a HomeKit TargetHumidifierDehumidifierState value to a VeSync mode.
|
|
50
|
+
* Inverse of modeToTargetState.
|
|
51
|
+
*/
|
|
52
|
+
private targetStateToMode;
|
|
32
53
|
protected setupService(): void;
|
|
33
54
|
/**
|
|
34
55
|
* Set up night light service for devices that support it
|
|
@@ -74,6 +95,7 @@ export declare class HumidifierAccessory extends BaseAccessory {
|
|
|
74
95
|
* Update device states based on the latest details
|
|
75
96
|
*/
|
|
76
97
|
protected updateDeviceSpecificStates(details: any): Promise<void>;
|
|
98
|
+
private applyDeviceStatesToHomeKit;
|
|
77
99
|
protected getDeviceCapabilities(): DeviceCapabilities;
|
|
78
100
|
private getActive;
|
|
79
101
|
private setActive;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"humidifier.accessory.d.ts","sourceRoot":"","sources":["../../src/accessories/humidifier.accessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,iBAAiB,EAAW,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE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