Exclude incompatible entities from temperature automations#169901
Merged
Conversation
Contributor
|
Hey there @home-assistant/core, 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 updates the temperature automation trigger and condition logic so that attribute-based temperature entities (climate, water_heater, weather) that do not currently expose a temperature attribute are excluded from any/all-style evaluations, preventing them from blocking behavior=last triggers and behavior=all conditions.
Changes:
- Add
_should_include()overrides to filter out attribute-based entities that lack the configured temperature attribute. - Align temperature trigger and condition behavior by applying the same inclusion rules in both paths.
- Update temperature trigger/condition tests to reflect and validate the new “attribute required” filtering behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| homeassistant/components/temperature/trigger.py | Excludes attribute-sourced entities missing the temperature attribute from all/count evaluations used by behavior=first/last. |
| homeassistant/components/temperature/condition.py | Applies the same inclusion filtering to prevent missing-attribute entities from blocking behavior=all conditions. |
| tests/components/temperature/test_trigger.py | Updates parametrized trigger tests to expect missing attribute states to be excluded (via attribute_required=True). |
| tests/components/temperature/test_condition.py | Updates parametrized condition tests to expect missing attribute states to be excluded (via attribute_required=True). |
frenck
approved these changes
May 6, 2026
frenck
pushed a commit
that referenced
this pull request
May 6, 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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Exclude incompatible entities from temperature automations
This means climate, water_heater and weather entities without temperature attribute won't block
lastchecks for triggers orallchecks for conditions.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: