mirror of
https://github.com/home-assistant/core.git
synced 2026-09-28 02:18:10 -04:00
Set responding state in assist satellite start_conversation (#141388)
* Set responding state in async_start_conversation * Check idle state
This commit is contained in:
@@ -594,6 +594,13 @@ async def test_start_conversation(
|
||||
expected_params: tuple[str, str],
|
||||
) -> None:
|
||||
"""Test starting a conversation on a device."""
|
||||
original_start_conversation = entity.async_start_conversation
|
||||
|
||||
async def async_start_conversation(start_announcement):
|
||||
# Verify state change
|
||||
assert entity.state == AssistSatelliteState.RESPONDING
|
||||
await original_start_conversation(start_announcement)
|
||||
|
||||
await async_update_pipeline(
|
||||
hass,
|
||||
async_get_pipeline(hass),
|
||||
@@ -620,6 +627,7 @@ async def test_start_conversation(
|
||||
mime_type="audio/mp3",
|
||||
),
|
||||
),
|
||||
patch.object(entity, "async_start_conversation", new=async_start_conversation),
|
||||
):
|
||||
await hass.services.async_call(
|
||||
"assist_satellite",
|
||||
@@ -628,6 +636,7 @@ async def test_start_conversation(
|
||||
target={"entity_id": "assist_satellite.test_entity"},
|
||||
blocking=True,
|
||||
)
|
||||
assert entity.state == AssistSatelliteState.IDLE
|
||||
|
||||
assert entity.start_conversations[0] == expected_params
|
||||
|
||||
|
||||
Reference in New Issue
Block a user