mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Add area slot to response for cancel all timers (#131638)
Add area slot to response
This commit is contained in:
parent
15bf0c728c
commit
192ffc09ee
@ -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
|
||||||
|
|
||||||
|
@ -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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user