From dc72c6c606915c2247c0b35dbe6fac2b0c6a25bc Mon Sep 17 00:00:00 2001 From: Maciej Bieniek Date: Tue, 6 Jul 2021 14:04:00 +0200 Subject: [PATCH] Improve config entry title for GIOS integration (#52583) * Improve GIOS config entry title * Usonly station name as title --- homeassistant/components/gios/config_flow.py | 2 +- tests/components/gios/test_config_flow.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/gios/config_flow.py b/homeassistant/components/gios/config_flow.py index 161dc1b0add..b8a52254c32 100644 --- a/homeassistant/components/gios/config_flow.py +++ b/homeassistant/components/gios/config_flow.py @@ -49,7 +49,7 @@ class GiosFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): await gios.async_update() return self.async_create_entry( - title=user_input[CONF_STATION_ID], + title=gios.station_name, data=user_input, ) except (ApiError, ClientConnectorError, asyncio.TimeoutError): diff --git a/tests/components/gios/test_config_flow.py b/tests/components/gios/test_config_flow.py index 6b1f829c4d8..21fc9d8bfda 100644 --- a/tests/components/gios/test_config_flow.py +++ b/tests/components/gios/test_config_flow.py @@ -99,7 +99,7 @@ async def test_create_entry(hass): result = await flow.async_step_user(user_input=CONFIG) assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY - assert result["title"] == CONFIG[CONF_STATION_ID] + assert result["title"] == "Test Name 1" assert result["data"][CONF_STATION_ID] == CONFIG[CONF_STATION_ID] assert flow.context["unique_id"] == "123"