Add ventilation preset modes to Duco fan entity#169685
Add ventilation preset modes to Duco fan entity#169685ronaldvdmeer wants to merge 6 commits intohome-assistant:devfrom
Conversation
Add MAN1, MAN2, MAN3 and EMPT as fan preset modes alongside the existing AUTO preset. The speed slider (CNT1/2/3) remains unchanged. Timed MAN variants (MAN1x2 etc.) map to their base preset when read.
There was a problem hiding this comment.
Pull request overview
This PR extends the Duco integration’s fan entity to expose named ventilation presets in addition to the existing percentage-based speed control, so Home Assistant users can select Duco-specific ventilation modes from the UI and automations.
Changes:
- Added Duco fan preset constants and state mappings for
auto,man1,man2,man3, andempt. - Updated the fan entity to report/set preset modes and kept percentage control for continuous speed states.
- Added user-facing preset labels and updated Duco fan tests/snapshots for the new preset list.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
homeassistant/components/duco/fan.py |
Adds preset-mode support and updates Duco ventilation state mapping logic for the fan entity. |
homeassistant/components/duco/strings.json |
Adds translated labels for the new fan preset modes. |
tests/components/duco/test_fan.py |
Expands fan service tests for the new preset commands and adjusts rate-limit logging assertions. |
tests/components/duco/snapshots/test_fan.ambr |
Updates the expected entity snapshot to include the new preset modes. |
- Add MAN1/MAN2/MAN3 (and timed variants) to _STATE_TO_PERCENTAGE so async_increase_speed steps from the current level instead of 0% - Add AUT1/AUT2/AUT3 to _STATE_TO_PRESET so automatic boost states report correctly instead of showing an unknown state - Add read-path parametrized test covering all VentilationState variants
MAN (timed) states only map to a preset, not to a percentage. Adjusting the slider always issues a CNT (continuous) command. These are distinct control modes on the Duco device and should not share the same percentage representation.
|
Important The percentage slider and presets are intentionally separate control paths on the Duco device. Adjusting the slider always issues a |
Proposed change
Extends the Duco fan entity with ventilation preset modes so users can set named ventilation levels from the UI and automations.
Previously the fan entity only exposed the speed slider (CNT1/CNT2/CNT3 → 33 %/66 %/100 %). This PR adds preset mode support:
autoAUTOman1MAN1man2MAN2man3MAN3emptEMPTReading state back:
man1,man2,man3).autopreset. They cannot be set from Home Assistant.Speed slider vs. presets:
The percentage slider and presets are intentionally separate control paths. The slider always issues a continuous override (
CNT), while presets issue a timed override (MAN). MAN states do not expose a percentage value — using the slider from a MAN preset transitions to a CNT state.Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: