-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Move target selector extractor method to common module #148087
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
base: dev
Are you sure you want to change the base?
Conversation
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.
I wasn't 100% if selector.py
would be the best place for this, but the alternative would be to create a new module, which does not seem worthy.
|
||
|
||
def async_extract_referenced_entity_ids( | ||
hass: HomeAssistant, selector_data: TargetSelectorData, expand_group: bool = True |
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.
Changing the signature of async_extract_referenced_entity_ids is a breaking change. It needs a blog post in case there are custom integrations using it.
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.
You could leave a wrapper in service.py
that sends it here, warns that its deprecated and take it out in 6 months to minimize potential breakage.
Maybe nothing outside of core is using it though so may not be needed. Would be good to do a GitHub code search and see if its used outside of core
) | ||
|
||
|
||
def async_extract_referenced_entity_ids( |
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.
Likely there are some tests that should move to tests/helpers/test_selector.py
TargetSelector, | ||
TargetSelectorData, | ||
async_extract_referenced_entity_ids, | ||
) |
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.
We can probably rely on the existing deprecation system for handling most of these imports.
Is this actually necessary? I'm not sure how much of a better location |
I agree. If we do the move, we should move the shared target stuff to a new module |
This will also be used by I'll move it to |
Proposed change
Since this method will also be used by trigger.py in #148086, this PR moves it to a better common location.
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: