Improve config entry title for GIOS integration (#52583)

* Improve GIOS config entry title

* Usonly station name as title
This commit is contained in:
Maciej Bieniek 2021-07-06 14:04:00 +02:00 committed by GitHub
parent b645560633
commit dc72c6c606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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):

View File

@ -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"