Clean up template engine after extension modularization#170346
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR performs small cleanup work after template engine modularization by removing a redundant import in the state template extension and relocating state-related template tests into the more appropriate test module.
Changes:
- Remove redundant
collections.abcimport and use the already-importedIterableinStateExtension.expand. - Move state infrastructure template tests from
test_init.pyintotest_states.py(no behavioral changes intended).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/helpers/template/test_states.py | Adds the moved state-related template tests and required imports/helpers. |
| tests/helpers/template/test_init.py | Removes state-related tests that were relocated to test_states.py. |
| homeassistant/helpers/template/extensions/state.py | Simplifies imports and updates isinstance(..., Iterable) usage accordingly. |
balloob
approved these changes
May 11, 2026
raman325
added a commit
to raman325/home-assistant
that referenced
this pull request
May 12, 2026
…-timer * upstream/dev: Bump infrared-protocols to 5.1.0 (home-assistant#170365) Clean up template engine after extension modularization (home-assistant#170346) Bump axis to v71 (home-assistant#170347) Enhance WebDAV metadata download with concurrency (home-assistant#170223) Add target temperature sensor for ViCare RadiatorActuator devices (home-assistant#170102) Bump pyzbar to 0.1.9 (home-assistant#170076) homematicip_cloud: fix HmIP-FLC lock state polarity (home-assistant#170159) Watts: add timer mode service (home-assistant#169846) Set parallel updates for Ecowitt platforms (home-assistant#170349) Add config flow to Avea (home-assistant#168070) Cleanup Eurotronic number platform (home-assistant#170337) Add number platform to eurotronic_cometblue (home-assistant#168119)
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
Small cleanup after the template engine modularization effort:
import collections.abcfrom the state extension (already importingIterablefromcollections.abcdirectly)test_invalid_entity_id,test_length_of_states,test_slice_states,test_state_attributes,test_unavailable_states) fromtest_init.pytotest_states.pywhere they belongThere is no functional change in this PR.
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: