mirror of
https://github.com/home-assistant/core.git
synced 2025-04-29 19:57:52 +00:00
Context slot decisions moved into hassil (#104132)
This commit is contained in:
parent
fd7f75e9af
commit
8c99cf14d3
@ -224,18 +224,11 @@ class DefaultAgent(AbstractConversationAgent):
|
|||||||
# loaded in async_recognize.
|
# loaded in async_recognize.
|
||||||
assert lang_intents is not None
|
assert lang_intents is not None
|
||||||
|
|
||||||
# Include slot values from intent_context, such as the name of the
|
# Slot values to pass to the intent
|
||||||
# device's area.
|
|
||||||
slots = {
|
slots = {
|
||||||
entity_name: {"value": entity_value}
|
entity.name: {"value": entity.value} for entity in result.entities_list
|
||||||
for entity_name, entity_value in result.context.items()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Override context with result entities
|
|
||||||
slots.update(
|
|
||||||
{entity.name: {"value": entity.value} for entity in result.entities_list}
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
intent_response = await intent.async_handle(
|
intent_response = await intent.async_handle(
|
||||||
self.hass,
|
self.hass,
|
||||||
|
@ -7,5 +7,5 @@
|
|||||||
"integration_type": "system",
|
"integration_type": "system",
|
||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
"quality_scale": "internal",
|
"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"]
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,10 @@ fnv-hash-fast==0.5.0
|
|||||||
ha-av==10.1.1
|
ha-av==10.1.1
|
||||||
ha-ffmpeg==3.1.0
|
ha-ffmpeg==3.1.0
|
||||||
hass-nabucasa==0.74.0
|
hass-nabucasa==0.74.0
|
||||||
hassil==1.5.0
|
hassil==1.5.1
|
||||||
home-assistant-bluetooth==1.10.4
|
home-assistant-bluetooth==1.10.4
|
||||||
home-assistant-frontend==20231030.2
|
home-assistant-frontend==20231030.2
|
||||||
home-assistant-intents==2023.11.13
|
home-assistant-intents==2023.11.17
|
||||||
httpx==0.25.0
|
httpx==0.25.0
|
||||||
ifaddr==0.2.0
|
ifaddr==0.2.0
|
||||||
janus==1.0.0
|
janus==1.0.0
|
||||||
|
@ -985,7 +985,7 @@ hass-nabucasa==0.74.0
|
|||||||
hass-splunk==0.1.1
|
hass-splunk==0.1.1
|
||||||
|
|
||||||
# homeassistant.components.conversation
|
# homeassistant.components.conversation
|
||||||
hassil==1.5.0
|
hassil==1.5.1
|
||||||
|
|
||||||
# homeassistant.components.jewish_calendar
|
# homeassistant.components.jewish_calendar
|
||||||
hdate==0.10.4
|
hdate==0.10.4
|
||||||
@ -1018,7 +1018,7 @@ holidays==0.36
|
|||||||
home-assistant-frontend==20231030.2
|
home-assistant-frontend==20231030.2
|
||||||
|
|
||||||
# homeassistant.components.conversation
|
# homeassistant.components.conversation
|
||||||
home-assistant-intents==2023.11.13
|
home-assistant-intents==2023.11.17
|
||||||
|
|
||||||
# homeassistant.components.home_connect
|
# homeassistant.components.home_connect
|
||||||
homeconnect==0.7.2
|
homeconnect==0.7.2
|
||||||
|
@ -778,7 +778,7 @@ habitipy==0.2.0
|
|||||||
hass-nabucasa==0.74.0
|
hass-nabucasa==0.74.0
|
||||||
|
|
||||||
# homeassistant.components.conversation
|
# homeassistant.components.conversation
|
||||||
hassil==1.5.0
|
hassil==1.5.1
|
||||||
|
|
||||||
# homeassistant.components.jewish_calendar
|
# homeassistant.components.jewish_calendar
|
||||||
hdate==0.10.4
|
hdate==0.10.4
|
||||||
@ -802,7 +802,7 @@ holidays==0.36
|
|||||||
home-assistant-frontend==20231030.2
|
home-assistant-frontend==20231030.2
|
||||||
|
|
||||||
# homeassistant.components.conversation
|
# homeassistant.components.conversation
|
||||||
home-assistant-intents==2023.11.13
|
home-assistant-intents==2023.11.17
|
||||||
|
|
||||||
# homeassistant.components.home_connect
|
# homeassistant.components.home_connect
|
||||||
homeconnect==0.7.2
|
homeconnect==0.7.2
|
||||||
|
@ -343,10 +343,10 @@ async def test_device_area_context(
|
|||||||
)
|
)
|
||||||
device_registry.async_update_device(bedroom_satellite.id, area_id=area_bedroom.id)
|
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(
|
result = await conversation.async_converse(
|
||||||
hass,
|
hass,
|
||||||
"turn on all lights",
|
"turn on the lights",
|
||||||
None,
|
None,
|
||||||
Context(),
|
Context(),
|
||||||
None,
|
None,
|
||||||
@ -367,7 +367,7 @@ async def test_device_area_context(
|
|||||||
# Ensure we can still target other areas by name
|
# Ensure we can still target other areas by name
|
||||||
result = await conversation.async_converse(
|
result = await conversation.async_converse(
|
||||||
hass,
|
hass,
|
||||||
"turn on all lights in the bedroom",
|
"turn on lights in the bedroom",
|
||||||
None,
|
None,
|
||||||
Context(),
|
Context(),
|
||||||
None,
|
None,
|
||||||
@ -388,7 +388,7 @@ async def test_device_area_context(
|
|||||||
# Turn off all lights in the area of the otherkj device
|
# Turn off all lights in the area of the otherkj device
|
||||||
result = await conversation.async_converse(
|
result = await conversation.async_converse(
|
||||||
hass,
|
hass,
|
||||||
"turn all lights off",
|
"turn lights off",
|
||||||
None,
|
None,
|
||||||
Context(),
|
Context(),
|
||||||
None,
|
None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user