core/homeassistant/helpers
CtrlZvi 1433cdaa12
Prefer shorter keys for intent matching (#43672)
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.
2021-01-27 12:16:19 +01:00
..
__init__.py Protect loop set default executor (#37438) 2020-07-06 15:58:53 -07:00
aiohttp_client.py more graceful shutdown in the presence of a proxy_stream (#45246) 2021-01-17 17:10:22 +01:00
area_registry.py Base area IDs on initial name (#43804) 2020-12-01 12:45:56 +01:00
check_config.py Better general/fallback error message and traceback for unknown config errors (#44655) 2021-01-05 13:55:38 +01:00
collection.py Gather all collection listeners and changes at the same time (#42497) 2020-10-29 10:06:55 +01:00
condition.py Add default config if not there (#43321) 2020-11-25 15:10:04 +01:00
config_entry_flow.py Add support for discovery via DHCP (#45087) 2021-01-14 09:09:08 +01:00
config_entry_oauth2_flow.py Add support for discovery via DHCP (#45087) 2021-01-14 09:09:08 +01:00
config_validation.py Changes to filename and path validation (#45529) 2021-01-26 15:53:21 +01:00
data_entry_flow.py Use http status constants more, add HTTP_ACCEPTED and HTTP_BAD_GATEWAY (#39993) 2020-09-15 20:01:07 +03:00
debounce.py Await callbacks to keep cleaner stacktraces (#43693) 2020-11-27 17:48:43 +01:00
deprecation.py Changes to filename and path validation (#45529) 2021-01-26 15:53:21 +01:00
device_registry.py Improve device registry type hints (#44919) 2021-01-08 02:38:57 +01:00
discovery.py Await callbacks to keep cleaner stacktraces (#43693) 2020-11-27 17:48:43 +01:00
dispatcher.py Determine how to run listeners at setup time instead of execution time (#41304) 2020-10-07 16:51:50 +02:00
entity.py Fix state overwrite race condition where two platforms request the same entity_id (#42151) 2020-10-21 17:01:51 +02:00
entity_component.py Make input_datetime better handle timezones (#43396) 2020-11-26 20:20:10 +01:00
entity_platform.py Helpers type hint improvements (#44964) 2021-01-09 00:08:34 +01:00
entity_registry.py Slightly improve error message in case of duplicate entity IDs (#45424) 2021-01-22 09:16:13 -05:00
entity_values.py Generics and other type hint improvements (#45250) 2021-01-18 22:23:25 +01:00
entityfilter.py Various type hint improvements (#37952) 2020-07-22 08:06:37 -07:00
event.py Fix script wait templates with now/utcnow (#44717) 2021-01-01 13:03:34 +01:00
frame.py Exception chaining and wrapping improvements (#39320) 2020-08-28 13:50:32 +02:00
httpx_client.py Create httpx helper to wrap a shared httpx.AsyncClient (#43877) 2020-12-09 17:18:57 +01:00
icon.py Various string cleanups (#30435) 2020-01-03 14:47:06 +01:00
instance_id.py Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
integration_platform.py Add logbook platforms (#37078) 2020-06-24 18:14:50 -07:00
intent.py Prefer shorter keys for intent matching (#43672) 2021-01-27 12:16:19 +01:00
json.py Cleanup unused loggers (components N-Z + tests) (#41982) 2020-10-16 21:24:08 -05:00
location.py Fix circular import of config_validation and template (#41802) 2020-11-04 19:06:19 -10:00
logging.py Upgrade mypy to 0.770, tighten config a bit (#32715) 2020-03-12 11:52:20 +01:00
network.py OAuth2 to use current request header (#43668) 2020-11-27 08:55:34 +01:00
ratelimit.py Fix async_track_utc_time_change firing too early (#42176) 2020-11-05 16:34:56 +01:00
reload.py Ensure config entry platforms are excluded from reload (#42367) 2020-10-25 23:53:31 +01:00
restore_state.py async_get_instance was not reentrant during await (#38263) 2020-08-12 22:35:24 +02:00
script.py Wait for all triggers when one fails to attach (#45361) 2021-01-20 22:13:21 +01:00
script_variables.py Set variable values in scripts (#39915) 2020-09-11 13:16:25 +02:00
selector.py Add selectors for text and arbitrary objects (#45112) 2021-01-27 09:20:19 +01:00
service.py Upgrade codespell to 2.0.0 (#44695) 2020-12-31 19:14:07 +01:00
signal.py Sort imports according to PEP8 for 'homeassistant' folder (#29789) 2019-12-09 16:42:10 +01:00
significant_change.py Light significant changes + sensor tweaks (#45583) 2021-01-26 22:11:06 +01:00
singleton.py Add tests for singleton decorator (#42055) 2020-10-18 22:41:22 +02:00
state.py Add transition support to scenes, cleanup blocking parameter (#34434) 2020-04-20 18:07:50 -07:00
storage.py Ensure storage task loads are always garbage collected (#42917) 2020-11-07 06:54:56 -10:00
sun.py Enable pylint import-outside-toplevel (#33631) 2020-04-04 17:07:36 +02:00
system_info.py System health improvement (#43066) 2020-11-10 23:56:50 +01:00
temperature.py Upgrade mypy to 0.770, tighten config a bit (#32715) 2020-03-12 11:52:20 +01:00
template.py Helpers type hint improvements (#44964) 2021-01-09 00:08:34 +01:00
translation.py Limit concurrency of async_get_integration to avoid creating extra threads (#43085) 2020-11-10 21:34:54 -10:00
trigger.py Wait for all triggers when one fails to attach (#45361) 2021-01-20 22:13:21 +01:00
typing.py Use singleton enum for "not set" sentinels (#41990) 2020-12-19 12:46:27 +01:00
update_coordinator.py Stop update_coordinator schedule refresh when HA is stopping (#45338) 2021-01-22 00:23:50 +01:00