Commit graph

56 commits

Author SHA1 Message Date
Allen Porter
f14471112d
Improve LLM tool quality by more clearly specifying device_class slots (#122723)
* Limit intent / llm API device_class slots to only necessary services and limited set of values

* Fix ruff errors

* Run ruff format

* Fix typing and improve output schema

* Fix schema and improve flattening

* Revert conftest

* Revert recorder

* Fix ruff format errors

* Update using latest version of voluptuous
2024-07-31 14:36:02 +02:00
epenet
07c7bb8b2a
Use HOMEASSISTANT_DOMAIN alias for core DOMAIN (#122760) 2024-07-29 13:35:36 +02:00
Michael Hansen
417abda649
Add HassGetCurrentDate and HassGetCurrentTime intents (#121707) 2024-07-11 00:17:04 +02:00
Michael Hansen
d515a7f063
Add created_seconds to timer info and pass to ESPHome devices (#120364) 2024-06-26 14:20:11 +02:00
Michael Hansen
d3ceaef098
Allow timer management from any device (#120440) 2024-06-26 09:06:56 +02:00
Michael Hansen
6d917f0242
Don't run timer callbacks for delayed commands (#120367)
* Don't send timer events for delayed commands

* Don't run timer callbacks for delayed commands
2024-06-24 16:21:51 -04:00
Michael Hansen
43ceb1c6c8
Handle case where timer device id exists but is not registered (delayed command) (#118410)
Handle case where device id exists but is not registered
2024-05-29 15:18:46 -04:00
Michael Hansen
3ffbbcfa5c
Allow delayed commands to not have a device id (#118390) 2024-05-29 12:39:41 -04:00
Michael Hansen
d223e1f2ac
Add Conversation command to timers (#118325)
* Add Assist command to timers

* Rename to conversation_command. Execute in timer code.

* Make agent_id optional

* Fix arg

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-28 20:33:31 -05:00
Paulus Schoutsen
615a1eda51
LLM Assist API to ignore intents if not needed for exposed entities or calling device (#118283)
* LLM Assist API to ignore timer intents if device doesn't support it

* Refactor to use API instances

* Extract ToolContext class

* Limit exposed intents based on exposed entities
2024-05-28 21:29:18 -04:00
Michael Hansen
9e1676bee4
Filter timers more when pausing/unpausing (#118331) 2024-05-28 19:36:34 -04:00
Michael Hansen
2dc49f0410
Add platforms to intent handlers (#118328) 2024-05-28 16:46:08 -04:00
tronikos
f2d0512f39
Make sure HassToggle and HassSetPosition have description (#118267) 2024-05-27 20:30:34 -04:00
Paulus Schoutsen
4a3808c08e
Don't crash when firing event for timer for unregistered device (#118132) 2024-05-26 13:08:00 +02:00
Paulus Schoutsen
ffc3560dad
Remove unneeded asserts (#118056)
* Remove unneeded asserts

* No need to guard changing a timer that is owned by a disconnected device
2024-05-24 14:56:57 -04:00
Michael Hansen
5be15c94bc
Require registered device id for all timer intents (#117946)
* Require device id when registering timer handlers

* Require device id for timer intents

* Raise errors for unregistered device ids

* Add callback

* Add types for callback to __all__

* Clean up

* More clean up
2024-05-24 12:55:52 -05:00
Michael Hansen
8079cc0464
Add description to intent handlers and use in LLM helper (#117864) 2024-05-21 12:54:34 -04:00
Marc Mueller
87bb7ced79
Use PEP 695 for simple type aliases (#117633) 2024-05-17 14:42:21 +02:00
Michael Hansen
e168cb96e9
Add area filter and rounded time to timers (#117527)
* Add area filter

* Add rounded time to status

* Fix test

* Extend test

* Increase test coverage
2024-05-16 09:45:14 -05:00
Michael Hansen
d441a62aa6
Remove "device_id" slot from timers (#117460)
Remove "device_id" slot
2024-05-14 15:48:24 -04:00
Michael Hansen
add6ffaf70
Add Assist timers (#117199)
* First pass at timers

* Move to separate file

* Refactor to using events

* Add pause/unpause/status

* Add ordinal

* Add test for timed Assist command

* Fix name matching

* Fix IntentHandleError

* Fix again

* Refactor to callbacks

* is_paused -> is_active

* Rename "set timer" to "start timer"

* Move tasks to timer manager

* More fixes

* Remove assist command

* Remove cancel by ordinal

* More tests

* Remove async on callbacks

* Export async_register_timer_handler
2024-05-14 14:42:32 -04:00
Denis Shulyaka
8168aff253
Update SetPositionIntentHandler intent schema (#116794)
Update SetPositionIntentHandler

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-10 14:33:11 -04:00
Michael Hansen
7923471b94
Intent target matching and media player enhancements (#115445)
* Working

* Tests are passing

* Fix climate

* Requested changes from review
2024-05-07 22:01:03 -04:00
Marc Mueller
8ca127df2a
Use KEY_HASS [h-z] (#112610) 2024-03-07 18:03:44 +01:00
Michael Hansen
0d0b64d351
Move HassSetPosition to homeassistant domain (#111867)
* Move HassSetPosition to homeassistant domain

* Add test for unsupported domain with HassSetPosition

* Split service intent handler

* cleanup

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-02-29 21:53:52 -05:00
Michael Hansen
ec4bd9a421
Add new intents for cover, valve, vacuum, and media player (#110757)
* Add valve to HassTurnOn/Off

* Add set position for valves

* Add set position to covers

* Add HassTurnOn/Off for vacuums

* Add media player intents

* Split out vacuum intents

* Address comments

* Extra test
2024-02-19 22:28:42 -05:00
Michael Hansen
2681dae60c
Matching duplicate named entities is now an error in Assist (#110050)
* Matching duplicate named entities is now an error

* Update snapshot

* Only use area id
2024-02-08 19:38:03 -06:00
Michael Hansen
1750f54da4
Assist fixes (#109889)
* Don't pass entity ids in hassil slot lists

* Use first completed response

* Add more tests
2024-02-07 15:13:42 -06:00
Marc Mueller
3c7a9272fa
Enable strict typing for intent (#107282) 2024-01-08 10:09:48 +01:00
Michael Hansen
9c2febc72e
Small code clean up (#103603) 2023-11-07 20:52:58 +01:00
Tudor Sandu
66dd3b153d
Support HassTurnOn/Off intents for lock domain (#93231)
* Support HassTurnOn/Off intents for lock domain

Fix https://github.com/home-assistant/intents/issues/1347

* Added tests

* Linting changes

* Linting
2023-11-01 09:46:13 -05:00
Michael Hansen
25671a2e42
Add HassNevermind intent (bump intents package) (#102131)
* Add HassNevermind intent

* Bump intents package to 2023.10.16
2023-10-16 19:13:26 -05:00
Allen Porter
12129e9d21
Update service call return values and error handling (#94657)
* Update return signature of service calls

* Add timeout error handling in websocket api for service calls

* Update recorder tests to remove assertion on service call

* Remove timeout behavior and update callers that depend on it today

* Fix tests

* Add missing else

* await coro directly

* Fix more tests

* Update the intent task to use wait instead of timeout

* Remove script service call limits and limit constants

* Update tests that depend on service call limits

* Use wait instead of wait_for and add test

* Update homeassistant/helpers/intent.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-06-16 07:01:40 -07:00
Erik Montnemery
9c01ea003c
Add empty config schema to integrations i-o (#93698) 2023-05-29 20:58:00 +02:00
Michael Hansen
74560ab139
Skip unexposed entities in intent handlers (#92415)
* Filter intent handler entities by exposure

* Add test for skipping unexposed entities
2023-05-03 12:18:31 -04:00
epenet
54f709f704
Adjust registry access in intent (#88881) 2023-02-28 21:58:19 -05:00
Michael Hansen
dc30210237
Use blocking in intent service calls and verify results (#88035)
* Use blocking in service calls and verify result

* Block for 2 seconds and update states after

* Small timeout in service call to allow exceptions

* Move sun test
2023-02-16 14:01:41 -05:00
Michael Hansen
8cd5106c15
Add HassGetState intent for queries (#87808)
* Use names instead of entity ids for list

* Add HassGetState for Assist queries

* Add unknown area to test

* Clean up and test device classes
2023-02-09 23:39:46 -05:00
Erik Montnemery
90d7fb8418
Sort manifests 5 (#87026) 2023-02-08 20:35:25 +01:00
Michael Hansen
f4654128db
Add synesthesiam as a codeowner on intent (#86998) 2023-01-30 23:46:42 -05:00
Michael Hansen
ea95abcb30
Use intent responses from home-assistant-intents (#86484)
* Use intent responses from home_assistant_intents

* Use error responses from home_assistant_intents

* Remove speech checks for intent tests (set by conversation now)

* Bump hassil and home-assistant-intents versions

* Use Home Assistant JSON reader when loading intents

* Remove speech checks for light tests (done in agent)

* Add more tests for code coverage

* Add test for reloading on new component

* Add test for non-default response
2023-01-23 22:38:41 -05:00
Michael Hansen
5aca996f22
HassTurnOn/Off intents to also handle cover entities (#86206)
* Move entity/area resolution to async_match_states

* Special case for covers in HassTurnOn/Off

* Enable light color/brightness on areas

* Remove async_register from default agent

* Remove CONFIG_SCHEMA from conversation component

* Fix intent tests

* Fix light test

* Move entity/area resolution to async_match_states

* Special case for covers in HassTurnOn/Off

* Enable light color/brightness on areas

* Remove async_register from default agent

* Remove CONFIG_SCHEMA from conversation component

* Fix intent tests

* Fix light test

* Fix humidifier intent handlers

* Remove DATA_CONFIG for conversation

* Copy ServiceIntentHandler code to light

* Add proper errors to humidifier intent handlers
2023-01-19 17:15:01 -06:00
Michael Hansen
961c8cc167
Update intent response (#83858)
* Add language to conversation and intent response

* Move language to intent response instead of speech

* Extend intent response for voice MVP

* Add tests for error conditions in conversation/process

* Move intent response type data into "data" field

* Move intent response error message back to speech

* Remove "success" from intent response

* Add id to target in intent response

* target defaults to None

* Update homeassistant/helpers/intent.py

* Fix test

* Return conversation_id and multiple targets

* Clean up git mess

* Fix linting errors

* Fix more async_handle signatures

* Separate conversation_id and IntentResponse

* Add unknown error code

* Add ConversationResult

* Don't set domain on single entity

* Language is required for intent response

* Add partial_action_done

* Default language in almond agent

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-12-13 16:46:40 -06:00
Franck Nijhof
2b27cfdabb
Set system & entity integration types (#79593) 2022-10-04 10:36:42 -04:00
Teemu R
a5c9c1880a
Add missing quality scales for internal integrations (#76499) 2022-09-28 13:46:20 +02:00
Franck Nijhof
69e622b327
Clean up accessing intent helpers via hass (#72028) 2022-05-17 20:33:51 +02:00
Ville Skyttä
939fde0a50
ConfigType and async_setup/setup type hint improvements (#54739) 2021-08-18 13:22:05 +02:00
Paulus Schoutsen
e584902b8b
Remove empty schema (#45044) 2021-01-11 14:25:09 +01:00
Philip Allgaier
625bbe6238
Cleanup unused loggers (components A-M) (#41600) 2020-10-12 16:59:05 +02:00
springstan
541e30d155
Remove unused manifest fields v2 (#33656) 2020-04-04 22:11:33 +02:00