-
-
Notifications
You must be signed in to change notification settings - Fork 36.4k
Support target triggers in automation relation extraction #160369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for extracting target references from automation triggers, enabling proper tracking of entities, devices, areas, floors, and labels referenced in new-style trigger configurations that support the target parameter.
Key Changes
- Extended automation relation extraction to support the
targetfield in trigger configurations - Added a new helper function
_get_targets_from_trigger_configto extract target references (entity_id, device_id, area_id, floor_id, label_id) - Optimized
referenced_labels,referenced_floors, andreferenced_areasproperties by changing from@propertyto@cached_propertyfor consistency and performance
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| homeassistant/components/automation/init.py | Adds target extraction logic to automation relation functions, including new helper function and updates to referenced_* properties to extract targets from trigger configs |
| tests/components/automation/test_init.py | Adds comprehensive test coverage for target extraction with single/multiple values for all target types (entities, devices, areas, floors, labels) and combined targets |
edenhaus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @abmantis 👍
Proposed change
SSIA.
Conditions will follow in a later 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: