KNX Fan: Add support for switch addresses#159367
Merged
Merged
Conversation
Contributor
|
Hey there @Julius2342, @marvin-w, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for KNX fan entities that use switch addresses for on/off control, either as the sole control method or in combination with speed control. This allows fans to respect the actuator's default turn-on speed when no specific percentage is provided.
Key changes:
- Refactored
async_turn_onandasync_turn_offto delegate to the underlying xknx device'sturn_on()andturn_off()methods instead of usingset_speed() - Made speed control optional in the schema, requiring at least one of switch or speed configuration
- Updated
supported_featuresto conditionally includeSET_SPEEDonly when speed control is initialized
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/knx/fan.py |
Refactored turn on/off methods to use device-level commands, added support for switch addresses in UI fan initialization, made speed features conditional |
homeassistant/components/knx/storage/entity_store_schema.py |
Updated schema to make both switch and speed optional with validation requiring at least one |
homeassistant/components/knx/strings.json |
Added UI labels and descriptions for the new switch group address field |
tests/components/knx/test_fan.py |
Added test case for switch-only fan configuration with state verification |
tests/components/knx/snapshots/test_websocket.ambr |
Updated snapshot to reflect new optional switch field in schema |
d8b4f5a to
fafaab7
Compare
8 tasks
joostlek
approved these changes
Dec 19, 2025
jcisio
pushed a commit
to jcisio/home-assistant-core
that referenced
this pull request
Dec 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
This adds support for knx fan entities that either only support switching (on/off binary) or support switching in addition to setting a speed. The actuators default turn-on speed will be respected then.
xknxwith Fix Fan turn_on default speed when step-mode is used XKNX/xknx#1775 this is added to HA here Update xknx to 3.13.0 #159371Type 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: