The dehumidifier uses a completely different API code namespace (`D*`) from the
air purifier (`A*`/`S*`). Modelling it as a separate `WinixDriver` subclass
keeps each device's wire-level mapping self-contained and avoids polluting
`AirPurifierDriver` with unrelated codes.
Note 1: Auto-Dry State
Some dehumidifier models automatically run an auto-dry cycle (~30 min fan) on
power-off to evaporate residual moisture. The hardware exposes this only as a
state (AUTO_DRY_VALUE, "auto-dry") — there is no explicit action to trigger it.
Note 2: Water Tank Status Ambiguity
A Water Tank value of 1 indicates either that the tank is missing or that it
is full. The hardware/API does not provide a way to distinguish between these
two specific conditions.
- Add `DehumidifierDriver` in `driver.py` covering the `D02`–`D15` code mapping
and the control methods the dehumidifier exposes.
- Add driver tests and fixtures covering control, RPC, and state parsing.
Related Issue, PR: #151, #154
This PR is the third split from PR #154. It contains only the DehumidifierDriver and its related unit tests. Since the device wrapper and the HA entity implementation for the dehumidifier are not yet included, there should be no impact on the air purifier.
29 unit tests have been added, for a total of 109 passing tests.
$ uv run --python 3.13 --with pytest-homeassistant-custom-component --with winix --with pycryptodome pytest tests/ -p asyncio --asyncio-mode=auto Test session starts (platform: linux, Python 3.13.7, pytest 9.0.0, pytest-sugar 1.0.0) rootdir: /home/kyet/ws/winix plugins: asyncio-1.3.0, pytest_freezer-0.4.9, github-actions-annotate-failures-0.3.0, aiohttp-1.1.0, syrupy-5.0.0, xdist-3.8.0, timeout-2.4.0, cov-7.0.0, sugar-1.0.0, respx-0.22.0, requests-mock-1.12.1, unordered-0.7.0, anyio-4.13.0, homeassistant-custom-component-0.13.316, picked-0.5.1, socket-0.7.0 asyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function collected 109 items tests/test_config_flow.py ✓✓✓✓ 4% ▍ tests/test_device_wrapper.py ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓ 27% ██▋ tests/test_driver.py ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓ 67% ██████▊ tests/test_fan.py ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓ 95% █████████▋ tests/test_sensor.py ✓✓✓✓✓ 100% ██████████ Results (0.69s): 109 passed