Only pass serializable data to media player intent (#145244)

This commit is contained in:
Paulus Schoutsen 2025-05-19 16:03:21 -04:00 committed by GitHub
parent 6afb60d31b
commit 741cb23776
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -336,6 +336,6 @@ class MediaSearchAndPlayHandler(intent.IntentHandler):
# Success
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
return response

View File

@ -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.
assert not response.speech
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
search_call = search_calls[0]