Add area slot to response for cancel all timers (#131638)

Add area slot to response
This commit is contained in:
Michael Hansen 2024-11-26 10:58:39 -06:00 committed by GitHub
parent 15bf0c728c
commit 192ffc09ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -908,7 +908,11 @@ class CancelAllTimersIntentHandler(intent.IntentHandler):
canceled += 1 canceled += 1
response = intent_obj.create_response() response = intent_obj.create_response()
response.async_set_speech_slots({"canceled": canceled}) speech_slots = {"canceled": canceled}
if "area" in slots:
speech_slots["area"] = slots["area"]["value"]
response.async_set_speech_slots(speech_slots)
return response return response

View File

@ -1741,6 +1741,7 @@ async def test_cancel_all_timers_area(
) )
assert result.response_type == intent.IntentResponseType.ACTION_DONE assert result.response_type == intent.IntentResponseType.ACTION_DONE
assert result.speech_slots.get("canceled", 0) == 1 assert result.speech_slots.get("canceled", 0) == 1
assert result.speech_slots.get("area") == "kitchen"
# No timers should be running in kitchen # No timers should be running in kitchen
result = await intent.async_handle( result = await intent.async_handle(