From 8c99cf14d37163780adbaa0174e38b32450b616c Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Fri, 17 Nov 2023 11:07:08 -0600 Subject: [PATCH] Context slot decisions moved into hassil (#104132) --- .../components/conversation/default_agent.py | 11 ++--------- homeassistant/components/conversation/manifest.json | 2 +- homeassistant/package_constraints.txt | 4 ++-- requirements_all.txt | 4 ++-- requirements_test_all.txt | 4 ++-- tests/components/conversation/test_default_agent.py | 8 ++++---- 6 files changed, 13 insertions(+), 20 deletions(-) diff --git a/homeassistant/components/conversation/default_agent.py b/homeassistant/components/conversation/default_agent.py index c1282bbbac1..99ebb4b60b1 100644 --- a/homeassistant/components/conversation/default_agent.py +++ b/homeassistant/components/conversation/default_agent.py @@ -224,18 +224,11 @@ class DefaultAgent(AbstractConversationAgent): # loaded in async_recognize. assert lang_intents is not None - # Include slot values from intent_context, such as the name of the - # device's area. + # Slot values to pass to the intent slots = { - entity_name: {"value": entity_value} - for entity_name, entity_value in result.context.items() + entity.name: {"value": entity.value} for entity in result.entities_list } - # Override context with result entities - slots.update( - {entity.name: {"value": entity.value} for entity in result.entities_list} - ) - try: intent_response = await intent.async_handle( self.hass, diff --git a/homeassistant/components/conversation/manifest.json b/homeassistant/components/conversation/manifest.json index 418342f714d..e99334b5c37 100644 --- a/homeassistant/components/conversation/manifest.json +++ b/homeassistant/components/conversation/manifest.json @@ -7,5 +7,5 @@ "integration_type": "system", "iot_class": "local_push", "quality_scale": "internal", - "requirements": ["hassil==1.5.0", "home-assistant-intents==2023.11.13"] + "requirements": ["hassil==1.5.1", "home-assistant-intents==2023.11.17"] } diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 377b538eb86..99b6a6a8392 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -25,10 +25,10 @@ fnv-hash-fast==0.5.0 ha-av==10.1.1 ha-ffmpeg==3.1.0 hass-nabucasa==0.74.0 -hassil==1.5.0 +hassil==1.5.1 home-assistant-bluetooth==1.10.4 home-assistant-frontend==20231030.2 -home-assistant-intents==2023.11.13 +home-assistant-intents==2023.11.17 httpx==0.25.0 ifaddr==0.2.0 janus==1.0.0 diff --git a/requirements_all.txt b/requirements_all.txt index d2b697df320..b0aff4e51f7 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -985,7 +985,7 @@ hass-nabucasa==0.74.0 hass-splunk==0.1.1 # homeassistant.components.conversation -hassil==1.5.0 +hassil==1.5.1 # homeassistant.components.jewish_calendar hdate==0.10.4 @@ -1018,7 +1018,7 @@ holidays==0.36 home-assistant-frontend==20231030.2 # homeassistant.components.conversation -home-assistant-intents==2023.11.13 +home-assistant-intents==2023.11.17 # homeassistant.components.home_connect homeconnect==0.7.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index ae02f403f44..3d12c8688c7 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -778,7 +778,7 @@ habitipy==0.2.0 hass-nabucasa==0.74.0 # homeassistant.components.conversation -hassil==1.5.0 +hassil==1.5.1 # homeassistant.components.jewish_calendar hdate==0.10.4 @@ -802,7 +802,7 @@ holidays==0.36 home-assistant-frontend==20231030.2 # homeassistant.components.conversation -home-assistant-intents==2023.11.13 +home-assistant-intents==2023.11.17 # homeassistant.components.home_connect homeconnect==0.7.2 diff --git a/tests/components/conversation/test_default_agent.py b/tests/components/conversation/test_default_agent.py index bc85cdf604c..fe94e2d5425 100644 --- a/tests/components/conversation/test_default_agent.py +++ b/tests/components/conversation/test_default_agent.py @@ -343,10 +343,10 @@ async def test_device_area_context( ) device_registry.async_update_device(bedroom_satellite.id, area_id=area_bedroom.id) - # Turn on all lights in the area of a device + # Turn on lights in the area of a device result = await conversation.async_converse( hass, - "turn on all lights", + "turn on the lights", None, Context(), None, @@ -367,7 +367,7 @@ async def test_device_area_context( # Ensure we can still target other areas by name result = await conversation.async_converse( hass, - "turn on all lights in the bedroom", + "turn on lights in the bedroom", None, Context(), None, @@ -388,7 +388,7 @@ async def test_device_area_context( # Turn off all lights in the area of the otherkj device result = await conversation.async_converse( hass, - "turn all lights off", + "turn lights off", None, Context(), None,