From 9cc934a9728c3f8c1b88a20d6b8e8fef7db492a1 Mon Sep 17 00:00:00 2001 From: rappenze Date: Mon, 21 Oct 2024 23:05:24 +0200 Subject: [PATCH] Fix description placeholder in transmission reauth (#128938) --- .../components/transmission/config_flow.py | 6 +++++- tests/components/transmission/test_config_flow.py | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/transmission/config_flow.py b/homeassistant/components/transmission/config_flow.py index 731c3da532a..a6e77dd23f7 100644 --- a/homeassistant/components/transmission/config_flow.py +++ b/homeassistant/components/transmission/config_flow.py @@ -15,6 +15,7 @@ from homeassistant.config_entries import ( ) from homeassistant.const import ( CONF_HOST, + CONF_NAME, CONF_PASSWORD, CONF_PATH, CONF_PORT, @@ -120,7 +121,10 @@ class TransmissionFlowHandler(ConfigFlow, domain=DOMAIN): return self.async_update_reload_and_abort(reauth_entry, data=user_input) return self.async_show_form( - description_placeholders={CONF_USERNAME: reauth_entry.data[CONF_USERNAME]}, + description_placeholders={ + CONF_USERNAME: reauth_entry.data[CONF_USERNAME], + CONF_NAME: reauth_entry.title, + }, step_id="reauth_confirm", data_schema=vol.Schema( { diff --git a/tests/components/transmission/test_config_flow.py b/tests/components/transmission/test_config_flow.py index b318862047e..b724a91f7a1 100644 --- a/tests/components/transmission/test_config_flow.py +++ b/tests/components/transmission/test_config_flow.py @@ -164,7 +164,10 @@ async def test_reauth_success(hass: HomeAssistant) -> None: assert result["type"] is FlowResultType.FORM assert result["step_id"] == "reauth_confirm" - assert result["description_placeholders"] == {"username": "user"} + assert result["description_placeholders"] == { + "username": "user", + "name": "Mock Title", + } with patch( "homeassistant.components.transmission.async_setup_entry", @@ -194,7 +197,10 @@ async def test_reauth_failed(hass: HomeAssistant, mock_api: MagicMock) -> None: assert result["type"] is FlowResultType.FORM assert result["step_id"] == "reauth_confirm" - assert result["description_placeholders"] == {"username": "user"} + assert result["description_placeholders"] == { + "username": "user", + "name": "Mock Title", + } mock_api.side_effect = TransmissionAuthError() result2 = await hass.config_entries.flow.async_configure( @@ -222,7 +228,10 @@ async def test_reauth_failed_connection_error( assert result["type"] is FlowResultType.FORM assert result["step_id"] == "reauth_confirm" - assert result["description_placeholders"] == {"username": "user"} + assert result["description_placeholders"] == { + "username": "user", + "name": "Mock Title", + } mock_api.side_effect = TransmissionConnectError() result2 = await hass.config_entries.flow.async_configure(