Commit graph

51 commits

Author SHA1 Message Date
Paulus Schoutsen
d6cd5648b9
Change conversation default agent behavior ()
* Change conversation default agent behavior

* Fix tests
2023-06-26 22:10:17 -04:00
Paulus Schoutsen
3f10233833
Add return value to conversation.process service ()
* Add return value to conversation.process service

* Adjust for new API
2023-06-23 13:32:03 -04:00
Michael Hansen
38614bc3f0
Add websocket command to test intent recognition for default agent ()
* Add websocket command to test intent recognition for default agent

* Return results as a list

* Only check intent name/entities in test

* Less verbose output in debug API
2023-06-22 12:24:59 -04:00
Paulus Schoutsen
cd330a2740
Pass device ID to conversation input () 2023-05-31 16:56:12 -04:00
Erik Montnemery
0126cfa9d9
Allow exposing any entity to the default conversation agent ()
* Allow exposing any entity to the default conversation agent

* Tweak

* Fix race, update tests

* Update tests
2023-05-03 09:45:54 -04:00
Erik Montnemery
4860a8d1e8
Don't use storage collection helper in ExposedEntities ()
* Don't use storage collection helper in ExposedEntities

* Fix tests
2023-05-03 12:39:22 +02:00
Erik Montnemery
e3c16e634b
Allow exposing entities not in the entity registry to assistants () 2023-05-02 22:08:09 +02:00
Erik Montnemery
f8f7de5d5a
Remove homeassistant from conversation dependencies ()
* Remove homeassistant from conversation dependencies

* Fix tests
2023-04-28 18:17:48 +02:00
Erik Montnemery
18f7b92438
Fall back to domain for conversation agents without title () 2023-04-25 22:14:44 +02:00
Paulus Schoutsen
d4fb2cdcf7
Conversation list command to support match-all languages agents ()
* Conversation list command to support match-all languages agnets

* Reuse var
2023-04-22 12:43:09 -04:00
Erik Montnemery
0429b321b8
Include matching languages in WS conversation/agent/list ()
* Include matching languages in WS conversation/agent/list

* Allow specifying country
2023-04-20 08:58:43 -04:00
Erik Montnemery
b5ab83def4
Add test for WS conversation/agent/info () 2023-04-19 11:15:21 -04:00
Erik Montnemery
5e9bbeb4ad
Refactor conversation agent WS API for listing agents ()
* Refactor conversation agent WS API for listing agents

* Add conversation/agent/info back
2023-04-19 10:53:24 -04:00
Paulus Schoutsen
c9d81bd217
Pipelines to default to Home Assistant agent ()
* Pipelines to default to Home Assistant agent

* Tests fix
2023-04-13 00:34:19 -04:00
Erik Montnemery
2c9e9d0fde
Allow UI configuration of entities exposed to voice_assistant ()
* Allow UI configuration of entities exposed to voice_assistant

* Invalidate cache when settings change

* Add tests

* Expose entities to conversation by default

* Update tests
2023-04-11 22:39:40 -04:00
Erik Montnemery
3c8397a7b9
Flush conversation name cache when an entity is renamed () 2023-04-11 08:33:08 -04:00
Paulus Schoutsen
ad26317b75
Conversation: allow getting agent info ()
* Conversation: allow getting agent info

* Add unset agenet back
2023-03-31 14:36:39 -04:00
epenet
0e4c32efe2
Adjust registry access in conversation () 2023-02-28 21:56:18 -05:00
Michael Hansen
59f2b2ad51
Bump intents package version; hassil==1.0.5; home-assistant-intents==2023.2.22 ()
* Bump hassil and intents versions

* Adjust tests to handle abbreviated responses
2023-02-22 09:36:42 -06:00
Michael Hansen
5bf3a0b7af
Load custom sentences for language variations (en-us, etc.) () 2023-02-20 12:28:04 -05:00
Michael Hansen
dc30210237
Use blocking in intent service calls and verify results ()
* 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
epenet
9f688a564f
Add type hints to integration tests (part 4) () 2023-02-11 08:26:13 +01:00
epenet
807c69f621
Add type hints to integration tests (b-c) () 2023-02-08 18:08:43 +01:00
Paulus Schoutsen
fc38b4327f
Add support for multiple conversation agents ()
* Add support for multiple conversation agents

* Lock initializing default agent

* Allow unsetting agent when never set
2023-02-03 23:35:29 -05:00
Michael Hansen
be69c81db5
Prioritize entity names over area names in Assist matching ()
* Refactor async_match_states

* Check entity name after state, before aliases

* Give entity name matches priority over area names

* Don't force result to have area

* Add area alias in tests

* Move name/area list creation back

* Clean up PR

* More clean up
2023-01-30 23:46:25 -05:00
J. Nick Koston
691a234090
Cache the names and area lists in the default agent ()
* Cache the names and area lists in the default agent

fixes 

* add coverage to make sure the entity cache busts

* add areas test

* cover the last line
2023-01-29 07:16:29 -05:00
Paulus Schoutsen
6c8efe3a3b
Conversation cleanup ()
* Require config entry when setting Conversation agent, add new unset agent method

* Remove onboarding from conversation agent

* Type attribution

* Wrap async_process params in ConversationInput object
2023-01-24 21:47:49 -06:00
Michael Hansen
ea95abcb30
Use intent responses from home-assistant-intents ()
* 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
epenet
30bf0634fe
Add per-file-ignore to pylint () 2023-01-22 17:26:24 +01:00
Michael Hansen
255611238b
Conversation config ()
* Restore conversation config

* Fall back to en for en_US, etc.

* Simplify config passing around

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-01-20 21:39:49 -05:00
Paulus Schoutsen
9631146745
Add conversation mobile app webhook ()
* Add conversation mobile app webhook

* Re-instate removed unused import which was used as fixture
2023-01-19 13:59:02 -05:00
Michael Hansen
2f98485ae7
Add conversation reload service ()
* Add preload and reload service calls to conversation

* Add conversation preload/reload to websocket API

* Merge prepare into reload

* reload service and prepare websocket API

* Add preload and reload service calls to conversation

* Add conversation preload/reload to websocket API

* Merge prepare into reload

* reload service and prepare websocket API

* Add language lock for loading intents

* Add more tests for code coverage
2023-01-18 19:36:51 -06:00
Michael Hansen
07bd208c7d
Load custom sentences from config directory ()
* Load custom sentences from config directory

* Load custom sentences from config directory

* Custom sentences in custom_sentences/<language>/

* Load custom sentences from config directory

* Custom sentences in custom_sentences/<language>/

* Add custom_sentences test
2023-01-09 16:48:59 -06:00
Michael Hansen
ecaec0332d
Hassil intents ()
* Add hassil to requirements

* Add intent sentences

* Update sentences

* Use hassil to recognize intents in conversation

* Fix tests

* Bump hassil due to dependency conflict

* Add dataclasses-json package contraints

* Bump hassil (removes dataclasses-json dependency)

* Remove climate sentences until intents are supported

* Move I/O outside event loop

* Bump hassil to 0.2.3

* Fix light tests

* Handle areas in intents

* Clean up code according to suggestions

* Remove sentences from repo

* Use home-assistant-intents package

* Apply suggestions from code review

* Flake8

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-01-07 16:20:21 -05:00
Paulus Schoutsen
96533e4c8f
Test conversation WS API () 2022-12-22 20:19:37 -05:00
Michael Hansen
98eabd2f68
Update intent response ()
* 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

* Remove partial_action_done

* Fix linting

* Rename success/fail targets

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-12-13 23:32:30 -05:00
Michael Hansen
961c8cc167
Update intent response ()
* 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
Michael Hansen
e71eb8dfe2
Update intent response ()
* 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

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-12-08 20:30:08 -05:00
Michael Hansen
ac87528bec
Add language to conversation and intent response ()
* Add language to conversation and intent response

* Add language parameter to conversation/process service

* Move language to intent response instead of speech

* Add language to almond conversation agent

* Fix intent test
2022-12-08 11:39:28 -05:00
Ville Skyttä
73d192b3f3
Use HTTPStatus instead of HTTP_ consts and magic values in comp.../[bc]* () 2021-10-22 19:43:40 +02:00
Paulus Schoutsen
111050bea9
Clean up core services ()
* Clean up core services

* Fix conversation test
2020-02-08 13:10:59 +01:00
Bas Nijholt
080c702d4f Sort imports according to PEP8 for components starting with "C" () 2019-12-09 18:56:21 +01:00
Paulus Schoutsen
d1aa0cea97
Move intent registration to own integration ()
* Move intent registration to own integration.

* Lint
2019-12-01 14:12:57 -08:00
Paulus Schoutsen
004476a1f8 Add intent integration to expose intent handle API ()
* Add intent integration to expose intent handle API.

* Run hassfest + fix scaffolding

* Update __init__.py
2019-11-27 11:25:43 +01:00
Paulus Schoutsen
c76f768a82 Make conversation and intent context aware ()
* WIP

* LINT
2019-11-26 11:30:21 +01:00
Michael Hansen
c2161b1f5a Add HTTP view to conversation to handle intents via JSON POST () 2019-11-19 13:47:03 -06:00
Paulus Schoutsen
fadb6a3979
Add support for conversation ID () 2019-11-07 12:21:12 -08:00
Paulus Schoutsen
a119932ee5
Refactor the conversation integration ()
* Refactor the conversation integration

* Lint
2019-10-18 11:46:45 -07:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen
65432ba552 Move core stuff into Home Assistant integration ()
* Move core stuff into Home Assistant integration

* Lint
2019-03-26 13:38:32 +01:00