mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Only pass serializable data to media player intent (#145244)
This commit is contained in:
parent
6afb60d31b
commit
741cb23776
@ -336,6 +336,6 @@ class MediaSearchAndPlayHandler(intent.IntentHandler):
|
|||||||
|
|
||||||
# Success
|
# Success
|
||||||
response = intent_obj.create_response()
|
response = intent_obj.create_response()
|
||||||
response.async_set_speech_slots({"media": first_result})
|
response.async_set_speech_slots({"media": first_result.as_dict()})
|
||||||
response.response_type = intent.IntentResponseType.ACTION_DONE
|
response.response_type = intent.IntentResponseType.ACTION_DONE
|
||||||
return response
|
return response
|
||||||
|
@ -688,8 +688,7 @@ async def test_search_and_play_media_player_intent(hass: HomeAssistant) -> None:
|
|||||||
# Response should contain a "media" slot with the matched item.
|
# Response should contain a "media" slot with the matched item.
|
||||||
assert not response.speech
|
assert not response.speech
|
||||||
media = response.speech_slots.get("media")
|
media = response.speech_slots.get("media")
|
||||||
assert isinstance(media, BrowseMedia)
|
assert media["title"] == "Test Track"
|
||||||
assert media.title == "Test Track"
|
|
||||||
|
|
||||||
assert len(search_calls) == 1
|
assert len(search_calls) == 1
|
||||||
search_call = search_calls[0]
|
search_call = search_calls[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user