Always include flow_id

This commit is contained in:
Erik
2025-04-07 13:52:00 +02:00
parent b459c36aff
commit 1aa2fb28e7
2 changed files with 6 additions and 1 deletions

View File

@@ -411,6 +411,7 @@ def config_entries_flow_subscribe(
msg["id"], msg["id"],
{ {
"type": change_type, "type": change_type,
"flow_id": flow_id,
"flow": hass.config_entries.flow.async_get(flow_id), "flow": hass.config_entries.flow.async_get(flow_id),
}, },
) )
@@ -428,7 +429,7 @@ def config_entries_flow_subscribe(
connection.send_message( connection.send_message(
websocket_api.event_message( websocket_api.event_message(
msg["id"], msg["id"],
{"type": "init", "flow": flw}, {"type": "init", "flow_id": flw["flow_id"], "flow": flw},
) )
) )
connection.send_result(msg["id"]) connection.send_result(msg["id"])

View File

@@ -985,6 +985,7 @@ async def test_get_progress_subscribe(
"step_id": "account", "step_id": "account",
"context": {"source": core_ce.SOURCE_HASSIO}, "context": {"source": core_ce.SOURCE_HASSIO},
}, },
"flow_id": form_hassio["flow_id"],
"type": "init", "type": "init",
}, },
"id": subscription, "id": subscription,
@@ -999,6 +1000,7 @@ async def test_get_progress_subscribe(
"step_id": "account", "step_id": "account",
"context": {"entry_id": "1234", "source": core_ce.SOURCE_REAUTH}, "context": {"entry_id": "1234", "source": core_ce.SOURCE_REAUTH},
}, },
"flow_id": form_reauth["flow_id"],
"type": "init", "type": "init",
}, },
"id": subscription, "id": subscription,
@@ -1115,6 +1117,7 @@ async def test_get_progress_subscribe_in_progress(
"step_id": "account", "step_id": "account",
"context": {"source": core_ce.SOURCE_HASSIO}, "context": {"source": core_ce.SOURCE_HASSIO},
}, },
"flow_id": form_hassio["flow_id"],
"type": "init", "type": "init",
}, },
"id": 1, "id": 1,
@@ -1131,6 +1134,7 @@ async def test_get_progress_subscribe_in_progress(
"source": core_ce.SOURCE_REAUTH, "source": core_ce.SOURCE_REAUTH,
}, },
}, },
"flow_id": form_reauth["flow_id"],
"type": "init", "type": "init",
}, },
"id": 1, "id": 1,