Commit Graph

133 Commits (b3b5ca9b9592f2df4ff5e2b740cb5c2b52cd2498)

Author SHA1 Message Date
Michael Hansen e0bdb3ecc3
Update intent sentences package (#88933)
* Actually use translated state names in response

* Change test result now that locks are excluded from HassTurnOn

* Bump home-assistant-intents and hassil versions
2023-02-28 21:07:18 -05:00
Michael Hansen a71487a42b
Make a copy of matching states so translated state names can be used (#88683) 2023-02-23 20:50:23 -05:00
Michael Hansen d5f1713498
Include binary_sensor in default Assist exposed domains (#88682) 2023-02-23 19:40:10 -05:00
Michael Hansen 59f2b2ad51
Bump intents package version; hassil==1.0.5; home-assistant-intents==2023.2.22 (#88605)
* 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.) (#88498) 2023-02-20 12:28:04 -05:00
Marc Mueller f3c6558db4
Improve conversation typing (#88440) 2023-02-19 21:27:30 -05:00
Michael Hansen 325674ec44
Only expose default cloud domains in Assist default agent (#88274)
* Only expose default cloud domains in default agent

* Copy exposed domain list to conversation

* Implement requested changes

* Add test for exposed devices/areas
2023-02-17 16:19:22 -05:00
epenet ba23816a0c
Inverse json import logic (#88099)
* Fix helpers and util

* Adjust components

* Move back errors

* Add report

* mypy

* mypy

* Assert deprecation messages

* Move test_json_loads_object

* Adjust tests

* Fix rebase

* Adjust pylint plugin

* Fix plugin

* Adjust references

* Adjust backup tests
2023-02-16 11:37:57 +01: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 87420e949d
Sort manifests 2 (#87023) 2023-02-08 20:16:39 +01:00
epenet a202588fd2
Add return type to json_loads (#85672)
* Add JSON type definitions

* Sample use

* Keep mutable for a follo-up PR (avoid dead code)

* Use list/dict

* Remove JsonObjectType

* Remove reference to Union

* Cleanup

* Improve rest

* Rename json_dict => json_data

* Add docstring

* Add type hint to json_loads

* Add cast

* Move type alias to json helpers

* Cleanup

* Create and use json_loads_object

* Make error more explicit and add tests

* Use JsonObjectType in conversation

* Remove quotes
2023-02-07 17:21:55 +01:00
Franck Nijhof 939eef3b28
Remove translations from Core (#87543)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-06 15:06:43 +01:00
Paulus Schoutsen fc38b4327f
Add support for multiple conversation agents (#87337)
* Add support for multiple conversation agents

* Lock initializing default agent

* Allow unsetting agent when never set
2023-02-03 23:35:29 -05:00
Paulus Schoutsen f32f46aff5
Fix Assist skipping entities that are hidden or have entity category (#87096)
Skipping entities that are hidden or have entity category
2023-02-01 10:48:04 -06:00
Michael Hansen 68450734f1
Bump home-assistant-intents to 2023.1.31 (#87034) 2023-01-31 10:23:03 -06:00
Michael Hansen be69c81db5
Prioritize entity names over area names in Assist matching (#86982)
* 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
Michael Hansen 28affe91be
Set synesthesiam as codeowner of conversation (#86958) 2023-01-30 23:02:25 +01:00
Michael Hansen f7fdaadde0
Performance improvements for Assist (#86966)
* Move hassil recognize into executor

* Bump hassil to 0.2.6

* Disable template parsing in name/area lists

* Don't iterate over hass.config.components directly
2023-01-30 12:25:22 -06:00
J. Nick Koston 691a234090
Cache the names and area lists in the default agent (#86874)
* Cache the names and area lists in the default agent

fixes #86803

* add coverage to make sure the entity cache busts

* add areas test

* cover the last line
2023-01-29 07:16:29 -05:00
Michael Hansen adeaf746ec
Use device area id in intent matching (#86678)
* Use device area id when matching

* Normalize whitespace in response

* Add extra test entity
2023-01-26 09:48:49 -06:00
Michael Hansen c5c68cd429
Bump home-assistant-intents 2023.1.25 (#86626)
* Bump home-assistant-intents 2022.1.25

* Use correct year in home-assistant-intents package
2023-01-25 10:50:15 -06:00
Paulus Schoutsen 6c8efe3a3b
Conversation cleanup (#86592)
* 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 (#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 255611238b
Conversation config (#86326)
* 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
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
Paulus Schoutsen 9631146745
Add conversation mobile app webhook (#86239)
* 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 (#86175)
* 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 (#85558)
* 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 (#85156)
* 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 (#84466) 2022-12-22 20:19:37 -05: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
Michael Hansen e71eb8dfe2
Update intent response (#83560)
* 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 (#83486)
* 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
epenet eca45f9dd0
Add websocket type hints in conversation (#80535) 2022-10-18 22:08:06 -04:00
Franck Nijhof 2b27cfdabb
Set system & entity integration types (#79593) 2022-10-04 10:36:42 -04:00
epenet 7e0515b119
Remove conversation from mypy ignore list (#74991) 2022-07-11 17:47:33 +02:00
Marc Mueller 9b9b553521
Disable no-self-use [pylint] (#70641)
* Disable no-self-use

* Remove disable comments
2022-04-25 07:41:01 -07:00
Franck Nijhof fa09cf663e
Update black to 22.1.0 (#65788) 2022-02-05 14:19:37 +01:00
Josh Soref 4bf0510b78
spelling: components/conversation (#64238)
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-01-17 16:27:25 +01:00
Erik Montnemery 3b7448bb1c
Import websocket_api (part 2) (#63906) 2022-01-11 17:26:25 +01:00
epenet 8fcca8c88b
Allow None agent in conversation (#63761) 2022-01-10 17:02:54 +01:00
epenet 9e16f87ddc
Add init type hints [b-c] (#63100)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-02 17:05:18 +01:00
epenet de64622f3b
Ensure service calls are typed [a-d] (#62891)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-28 00:14:20 +01:00
GitHub Action d3c020325b [ci skip] Translation update 2021-11-25 00:13:33 +00:00
Marc Mueller b1d49b3b66
Use assignment expressions 29 (#58713) 2021-10-30 16:31:43 +02:00
Marc Mueller f149bef9f3
Use assignment expressions 18 (#57967) 2021-10-18 18:36:35 +02:00
Ville Skyttä d8d34fdd3b
Prefer HTTPStatus over int in HA view JSON functions (#56504)
* Prefer HTTPStatus over int in HA view JSON functions

* Update zwave tests to not expect a fixed typo
2021-09-22 21:59:52 +03:00
Marc Mueller 48bada5a18
Update pylint to 2.11.1 (#56364) 2021-09-18 13:52:59 +02:00
GitHub Action 8c5620e74b [ci skip] Translation update 2021-08-02 03:40:04 +00:00
Shay Levy cf228e3fe5
Add constructor return type in integrations A-D (#50903) 2021-05-20 18:51:39 +03:00
Franck Nijhof 055cdc64c0
Add support for IoT class in manifest (#46935) 2021-04-15 10:21:38 +02:00
Marc Mueller 8e2b5b36b5
Bump pyupgrade to 2.12.0 (#48943) 2021-04-09 09:58:27 -07:00
Marc Mueller 7c0734bdd5
Update typing 05 (#48038) 2021-03-17 23:43:55 +01:00
Franck Nijhof ea4bbd771f
Add service names to previously enriched services (#46929)
Co-authored-by: Tobias Sauerwein <cgtobi@users.noreply.github.com>
2021-02-23 14:10:13 +01:00
Franck Nijhof b9d5b3c34e
Add selectors to Conversation, Image Processing and Number service definitions (#46746) 2021-02-18 17:13:59 +01:00
Philip Allgaier 625bbe6238
Cleanup unused loggers (components A-M) (#41600) 2020-10-12 16:59:05 +02:00
Ville Skyttä 1bf2c4d976
Upgrade pylint to 2.6.0 (#39363) 2020-08-29 07:59:24 +02:00
Joakim Sørensen 730a257f3c
Rename translations dir for integrations (#34494) 2020-04-21 16:11:05 -07:00
Paulus Schoutsen 95357dfc55 Update translations 2020-04-20 16:33:54 -07:00
Paulus Schoutsen 0d60d40512 Update translations 2020-04-16 13:00:10 -07:00
Paulus Schoutsen 6119e79023
Migrate frontend translations of domains to backend (#34294) 2020-04-16 11:52:27 -07:00
springstan fb8f8133a0
Use HTTP_INTERNAL_SERVER_ERROR constant (#33832) 2020-04-08 23:20:03 +02:00
Franck Nijhof 24840b54ac
Add yamllint (in pre-commit and CI) (#33676)
* Add yamllint (in pre-commit and CI)

* Fix linting for all YAML files

* Bump and add it to requirements

* Fix gen_requirements for pre-commit, remove 'v' from version
2020-04-05 10:33:45 +02:00
Paulus Schoutsen f1d3c0d19b
Remove unused manifest fields (#33595) 2020-04-03 12:58:19 -07:00
Paulus Schoutsen 111050bea9
Clean up core services (#31509)
* Clean up core services

* Fix conversation test
2020-02-08 13:10:59 +01:00
Franck Nijhof bfa0edaf92 Migrate Integration Quality Scale from docs to manifest: internal (#30551) 2020-01-07 20:58:49 +01:00
Franck Nijhof a84741392b
Format all manifests with prettier (#30521) 2020-01-06 21:28:23 +01:00
Bas Nijholt 080c702d4f Sort imports according to PEP8 for components starting with "C" (#29763) 2019-12-09 18:56:21 +01:00
Paulus Schoutsen d1aa0cea97
Move intent registration to own integration (#29280)
* 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 (#29124)
* 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 (#28965)
* WIP

* LINT
2019-11-26 11:30:21 +01:00
Michael Hansen c2161b1f5a Add HTTP view to conversation to handle intents via JSON POST (#28818) 2019-11-19 13:47:03 -06:00
Bram Kragten 28c6837f00 Add attribution and onboarding commands to conversation and Almond (#28621)
* Add attribution and onboarding commands to conversation and Almond

* False -> None

* Comments

* Update __init__.py

* Comments + websocket for convert

* Lint
2019-11-08 09:06:23 -08:00
Paulus Schoutsen fadb6a3979
Add support for conversation ID (#28620) 2019-11-07 12:21:12 -08:00
Paulus Schoutsen a119932ee5
Refactor the conversation integration (#27839)
* Refactor the conversation integration

* Lint
2019-10-18 11:46:45 -07:00
Franck Nijhof c7da781efc Update documentation link URL for integrations in all manifests (#27114) 2019-10-02 09:25:44 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
cgtobi 2c07bfb9e0 Remove dependencies and requirements (#23024)
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00
Paulus Schoutsen cfe4cf30ad
Add manifests (#22699)
* Add manifests

* Update auto name

* Update codeowners

* Add requirements from platforms

* Minor cleanup

* Incorporate changes from awarecan PR
2019-04-03 21:14:45 -07:00
Paulus Schoutsen 4b1de61110
Use relative imports inside integrations (#22235)
* Use relative imports inside integrations

* Lint

* Fix automation tests

* Fix scene imports
2019-03-20 22:56:46 -07:00
Fabian Affolter 127c55e0c1
Update file header (#21023)
* Update file header

* Update file header

* Update file header

* Update file header

* Update file header

* Fix lint issues
2019-02-13 21:21:14 +01:00
Marcel Hoppe 45649824ca rewrite hangouts to use intents instead of commands (#16220)
* rewrite hangouts to use intents instead of commands

* small fixes

* remove configured_hangouts check and CONFIG_SCHEMA

* Lint

* add import from .config_flow
2018-08-28 00:20:12 +02:00
stephanerosi ff01aa40c9 Add help for conversation/process service (#14323)
* Add help for conversation/process service

* Add logging to debug text received when service is called

* Move conversation to specific folder
2018-05-08 13:24:27 -04:00