From 374dcde48745cb2f036aac9b5fed8c7cfb9a63e6 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 26 Mar 2021 18:31:29 +0100 Subject: [PATCH] Return config entry details after creation (#48316) --- homeassistant/components/config/config_entries.py | 2 +- tests/components/config/test_config_entries.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/config/config_entries.py b/homeassistant/components/config/config_entries.py index b45b6abe468..af90cdcba4b 100644 --- a/homeassistant/components/config/config_entries.py +++ b/homeassistant/components/config/config_entries.py @@ -155,7 +155,7 @@ class ConfigManagerFlowResourceView(FlowManagerResourceView): return super()._prepare_result_json(result) data = result.copy() - data["result"] = data["result"].entry_id + data["result"] = entry_json(result["result"]) data.pop("data") return data diff --git a/tests/components/config/test_config_entries.py b/tests/components/config/test_config_entries.py index d6cc474fa8b..7e4df556fa5 100644 --- a/tests/components/config/test_config_entries.py +++ b/tests/components/config/test_config_entries.py @@ -379,7 +379,17 @@ async def test_two_step_flow(hass, client): "type": "create_entry", "title": "user-title", "version": 1, - "result": entries[0].entry_id, + "result": { + "connection_class": "unknown", + "disabled_by": None, + "domain": "test", + "entry_id": entries[0].entry_id, + "source": "user", + "state": "loaded", + "supports_options": False, + "supports_unload": False, + "title": "user-title", + }, "description": None, "description_placeholders": None, }