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
* Make color_name_to_rgb raise
* Add Light Set Color intent
* Move some methods around
* Cleanup
* Prevent 1 more func call
* Make a generic Set intent for light
* Lint
* lint
* Add intent component
* Add intent script component
* Add shopping list component
* Convert Snips to use intent component
* Convert Alexa to use intent component
* Lint
* Fix Alexa tests
* Update snips test
* Add intent support to conversation
* Add API to view shopping list contents
* Lint
* Fix demo test
* Lint
* lint
* Remove type from slot schema
* Add dependency to conversation
* Move intent to be a helper
* Fix conversation
* Clean up intent helper
* Fix Alexa
* Snips to use new hass.components
* Allow registering intents with conversation at any point in time
* Shopping list to register sentences
* Add HTTP endpoint to Conversation
* Add async action option to intent_script
* Update API.ai to use intents
* Cleanup Alexa
* Shopping list component to register built-in panel
* Rename shopping list intent to inlude Hass name