Fix exposure checks on some intents#118988
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
|
|
Hey there @home-assistant/core, @Shulyaka, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
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
|
|
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
|
|
Shouldn't we just derive them from |
|
The |
| description = "Set desired humidity level" | ||
| slot_schema = { | ||
| vol.Required("name"): cv.string, | ||
| vol.Required("name"): intent.non_empty_string, |
There was a problem hiding this comment.
How does this translate to LLMs?
There was a problem hiding this comment.
It protects the user from them 😄
There was a problem hiding this comment.
This is to prevent the LLM from sending in an empty string and targeting all entities.
* Check exposure in climate intent * Check exposure in todo list * Check exposure for weather * Check exposure in humidity intents * Add extra checks to weather tests * Add more checks to todo intent test * Move climate intents to async_match_targets * Update test_intent.py * Update test_intent.py * Remove patch
Proposed change
Intent handlers deriving from
ServiceIntentHandlerbenefit from a comprehensive set of checks, including verifying that matched entities are exposed to the requesting assistant.There are several domains with intent handlers that do not derive from
ServiceIntentHandler, including:weatherclimatetodohumidifierThese intent handlers were not passing the required assistant info to the matching functions in order to filter out unexposed entities.
This PR adds exposure checks for the above domains, and ports their matching logic to use the newer
async_match_targetsfunction.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..coveragerc.To help with the load of incoming pull requests: