* 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>
* 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
* 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>
* support live reload of intent_script
* add services.yaml
* update tesls for full code coverage
* Update based on feedback
* fix intent_script reload when no intent_script config
* Update homeassistant/helpers/intent.py
* update tests to handle no_existing better
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* 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
* 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
* 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
* 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
* 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>
* 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>
* 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>
* 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
When using fuzzy matching to match entity names for intents, whichever
entity is first is preferred in the case of equal matches. This leads
to situations where entities with similar names (such as entities named
for their area and then specific area location) may be used when the
whole area is wanted.
I ran into this with the my Phillips Hue lights. I have each individual
light named such that its room is the first part of the name, and its
location within the room after. So my living room has:
Living Room West
Living Room Northwest
Living Room North
Living Room Northeast
I then have a group for the whole room:
Living Room
Because the group is the last of the entities, trying to adjust the
whole room only activates one light, because all of the lights match
equally well.
By preferring the shortest of equal matches, we prefer keys that have
the least amount of extra information, causing "Living Room" to match
the group instead of an individual light.
* Type hint additions
* Remove optional from sidebar_icon comment
Co-Authored-By: Franck Nijhof <frenck@frenck.nl>
* Remove optional from sidebar_title comment
Co-Authored-By: Franck Nijhof <frenck@frenck.nl>
* Fix issues after rebase and mypy 0.730
* Add type hints to helpers.intent and location
* Test typing for helpers.icon, json, and typing
* Add type hints to helpers.state
* Add type hints to helpers.translation