From 465624ef51b82f5aadcc6a842a2aaa751f28b8b3 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 19 Aug 2026 13:43:06 +0200 Subject: [PATCH] Forward service call context to entity in assist_satellite.ask_question (#179536) Co-authored-by: Claude --- homeassistant/components/assist_satellite/__init__.py | 2 ++ tests/components/assist_satellite/test_entity.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/homeassistant/components/assist_satellite/__init__.py b/homeassistant/components/assist_satellite/__init__.py index abc435f4a22e..a1fd10f07ab6 100644 --- a/homeassistant/components/assist_satellite/__init__.py +++ b/homeassistant/components/assist_satellite/__init__.py @@ -131,6 +131,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: f"Invalid Assist satellite entity id: {satellite_entity_id}" ) + satellite_entity.async_set_context(call.context) + ask_question_args = { "question": call.data.get("question"), "question_media_id": call.data.get("question_media_id"), diff --git a/tests/components/assist_satellite/test_entity.py b/tests/components/assist_satellite/test_entity.py index 59a7a9fb5098..b8049b8ac96b 100644 --- a/tests/components/assist_satellite/test_entity.py +++ b/tests/components/assist_satellite/test_entity.py @@ -916,6 +916,7 @@ async def test_ask_question( """Test asking a question on a device and matching an answer.""" entity_id = "assist_satellite.test_entity" question_text = "What kind of music would you like to listen to?" + context = Context() await async_update_pipeline( hass, async_get_pipeline(hass), stt_engine="test-stt-engine", stt_language="en" @@ -982,9 +983,11 @@ async def test_ask_question( {"entity_id": entity_id, "question": question_text, **service_data}, blocking=True, return_response=True, + context=context, ) assert entity.state == AssistSatelliteState.IDLE assert response == asdict(expected_answer) + assert hass.states.get(entity_id).context is context async def test_ask_question_requires_entity_permission(