Add tests asserting condition features#168881
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the “condition options/feature contract” test coverage across many entity condition platforms, ensuring concrete condition classes keep (or intentionally change) support for options like behavior and for when base classes evolve.
Changes:
- Add new parametrized tests per condition platform asserting which options are accepted/rejected via
assert_condition_options_supported. - Cover a wide set of condition domains (state-based, cover-derived, and numerical threshold-based) under Labs preview features.
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/components/window/test_condition.py | Add options-support assertions for window.is_open/is_closed. |
| tests/components/water_heater/test_condition.py | Add options-support assertions for water_heater.is_on/is_off. |
| tests/components/valve/test_condition.py | Add options-support assertions for valve.is_open/is_closed. |
| tests/components/vacuum/test_condition.py | Add options-support assertions for vacuum activity conditions. |
| tests/components/update/test_condition.py | Add options-support assertions for update availability conditions. |
| tests/components/todo/test_condition.py | Add options-support assertions for todo.all_completed. |
| tests/components/timer/test_condition.py | Add options-support assertions for timer status conditions. |
| tests/components/text/test_condition.py | Add options-support assertions for text.is_equal_to. |
| tests/components/temperature/test_condition.py | Add options-support assertions for temperature.is_value (threshold options). |
| tests/components/switch/test_condition.py | Add options-support assertions for switch.is_on/is_off. |
| tests/components/siren/test_condition.py | Add options-support assertions for siren.is_on/is_off. |
| tests/components/select/test_condition.py | Add options-support assertions for select.is_option_selected. |
| tests/components/schedule/test_condition.py | Add options-support assertions for schedule.is_on/is_off. |
| tests/components/remote/test_condition.py | Add options-support assertions for remote.is_on/is_off. |
| tests/components/power/test_condition.py | Add options-support assertions for power.is_value (threshold options). |
| tests/components/occupancy/test_condition.py | Add options-support assertions for occupancy conditions. |
| tests/components/motion/test_condition.py | Add options-support assertions for motion conditions. |
| tests/components/moisture/test_condition.py | Add options-support assertions for moisture conditions. |
| tests/components/media_player/test_condition.py | Add options-support assertions for media player conditions. |
| tests/components/lock/test_condition.py | Add options-support assertions for lock state conditions. |
| tests/components/light/test_condition.py | Add options-support assertions for light.is_on/is_off. |
| tests/components/lawn_mower/test_condition.py | Add options-support assertions for lawn mower activity conditions. |
| tests/components/illuminance/test_condition.py | Add options-support assertions for illuminance conditions. |
| tests/components/humidity/test_condition.py | Add options-support assertions for humidity.is_value (threshold options). |
| tests/components/humidifier/test_condition.py | Add options-support assertions for humidifier state/action conditions. |
| tests/components/gate/test_condition.py | Add options-support assertions for gate.is_open/is_closed. |
| tests/components/garage_door/test_condition.py | Add options-support assertions for garage_door.is_open/is_closed. |
| tests/components/fan/test_condition.py | Add options-support assertions for fan.is_on/is_off. |
| tests/components/door/test_condition.py | Add options-support assertions for door.is_open/is_closed. |
| tests/components/cover/test_condition.py | Add options-support assertions for multiple cover device-class conditions. |
| tests/components/counter/test_condition.py | Add options-support assertions for counter.is_value (threshold options). |
| tests/components/climate/test_condition.py | Add options-support assertions for key climate conditions. |
| tests/components/calendar/test_condition.py | Add options-support assertions for calendar.is_event_active. |
| tests/components/battery/test_condition.py | Add options-support assertions for battery-related conditions. |
| tests/components/assist_satellite/test_condition.py | Add options-support assertions for assist satellite state conditions. |
| tests/components/alarm_control_panel/test_condition.py | Add options-support assertions for alarm control panel conditions. |
MartinHjelmare
requested changes
Apr 23, 2026
Member
MartinHjelmare
left a comment
There was a problem hiding this comment.
The PR description is incorrect. It talks about air quality.
Contributor
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
MartinHjelmare
approved these changes
Apr 24, 2026
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
Add tests asserting condition features
This extends #168731 to other conditions: Make sure we don't accidentally add or remove features in concrete condition classes when modifying the base classes
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: