-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Fix supported features in Assist Satellite #148561
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?
Fix supported features in Assist Satellite #148561
Conversation
Hey there @home-assistant/core, @synesthesiam, 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 fixes the configuration of the Assist Satellite service description for the ask_question
service by correcting the entity selector's supported features configuration.
- Restructures the entity selector to use proper
filter
syntax instead of placingsupported_features
directly underentity
- Replaces enum name with direct integer value (2) since enum names aren't supported in this context
- Updates the selector validation to accept both integer values and string lists for supported features
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
homeassistant/helpers/selector.py |
Updates validation logic to handle both integer and string list formats for supported features |
homeassistant/components/assist_satellite/services.yaml |
Fixes service configuration structure and replaces enum reference with integer value |
e46a15f
to
ae757f3
Compare
@@ -154,7 +151,7 @@ class BaseSelectorConfig(TypedDict, total=False): | |||
vol.Optional("device_class"): vol.All(cv.ensure_list, [str]), | |||
# Features supported by the entity | |||
vol.Optional("supported_features"): [ | |||
vol.All(cv.ensure_list, [str], _validate_supported_features) | |||
vol.Any(int, vol.All(cv.ensure_list, [str], _validate_supported_features)) |
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.
Why would we accept integers and not rely on _validate_supported_features
resolving 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.
This check is run in two different contexts:
- It is run fully offline by
hassfest
. - It is run in a much more limited fashion during runtime.
So as a result this check (and therefore translation of feature names) is run and does work for a target
selector, but it is not run for other fields, in particular for any entity selectors.
Entity selectors are quite rare though, the only ones with supported features and therefore affected by this bug are this one and ai_task.generate_data
. So the idea of this fix is to allow manually putting ints and use them for those two services.
An alternative fix would be to run the check fully for all fields for all services also during runtime. Yet another alternative would be to switch those two affected services to use a target selector.
Let's fix the two problems separately, starting with #148580. |
Proposed change
Fix supported features in Assist Satellite service description for
ask_question
.This fixes two problems:
We have to use
filter
, we can't putsupported_features
directly underentity
.We don't currently support enum names for features at this position, so we have to use a direct int.
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: