Skip to content

Commit ca90826

Browse files
Use satellite area in fuzzy matcher (#155347)
Co-authored-by: Robert Resch <robert@resch.dev>
1 parent dd4789a commit ca90826

File tree

8 files changed

+29
-16
lines changed

8 files changed

+29
-16
lines changed

homeassistant/components/assist_satellite/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"documentation": "https://www.home-assistant.io/integrations/assist_satellite",
77
"integration_type": "entity",
88
"quality_scale": "internal",
9-
"requirements": ["hassil==3.3.0"]
9+
"requirements": ["hassil==3.4.0"]
1010
}

homeassistant/components/conversation/default_agent.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,16 @@ def _recognize_fuzzy(
768768
if lang_intents.fuzzy_matcher is None:
769769
return None
770770

771-
fuzzy_result = lang_intents.fuzzy_matcher.match(user_input.text)
771+
context_area: str | None = None
772+
satellite_area, _ = self._get_satellite_area_and_device(
773+
user_input.satellite_id, user_input.device_id
774+
)
775+
if satellite_area:
776+
context_area = satellite_area.name
777+
778+
fuzzy_result = lang_intents.fuzzy_matcher.match(
779+
user_input.text, context_area=context_area
780+
)
772781
if fuzzy_result is None:
773782
return None
774783

@@ -1240,15 +1249,14 @@ def _load_intents(self, language: str) -> LanguageIntents | None:
12401249
intent_slot_list_names=self._fuzzy_config.slot_list_names,
12411250
slot_combinations={
12421251
intent_name: {
1243-
combo_key: [
1244-
SlotCombinationInfo(
1245-
name_domains=(
1246-
set(combo_info.name_domains)
1247-
if combo_info.name_domains
1248-
else None
1249-
)
1250-
)
1251-
]
1252+
combo_key: SlotCombinationInfo(
1253+
context_area=combo_info.context_area,
1254+
name_domains=(
1255+
set(combo_info.name_domains)
1256+
if combo_info.name_domains
1257+
else None
1258+
),
1259+
)
12521260
for combo_key, combo_info in intent_combos.items()
12531261
}
12541262
for intent_name, intent_combos in self._fuzzy_config.slot_combinations.items()

homeassistant/components/conversation/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"documentation": "https://www.home-assistant.io/integrations/conversation",
77
"integration_type": "entity",
88
"quality_scale": "internal",
9-
"requirements": ["hassil==3.3.0", "home-assistant-intents==2025.10.28"]
9+
"requirements": ["hassil==3.4.0", "home-assistant-intents==2025.10.28"]
1010
}

homeassistant/package_constraints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ go2rtc-client==0.2.1
3737
ha-ffmpeg==3.2.2
3838
habluetooth==5.7.0
3939
hass-nabucasa==1.4.0
40-
hassil==3.3.0
40+
hassil==3.4.0
4141
home-assistant-bluetooth==1.13.1
4242
home-assistant-frontend==20251001.4
4343
home-assistant-intents==2025.10.28

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

script/hassfest/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/components/conversation/test_default_agent.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3343,6 +3343,11 @@ async def test_language_with_alternative_code(
33433343
"HassLightSet",
33443344
{"name": "office light", "brightness": "50%"},
33453345
),
3346+
(
3347+
"turn on the lights in the spaceship",
3348+
"HassTurnOn",
3349+
{"domain": "lights", "area": "office"}, # context area
3350+
),
33463351
],
33473352
)
33483353
async def test_fuzzy_matching(

0 commit comments

Comments
 (0)