From 0a700f7272abb948317066a47c4232d3d03f911e Mon Sep 17 00:00:00 2001 From: SNoof85 Date: Thu, 1 Oct 2020 11:31:43 +0200 Subject: [PATCH] Common strings in Freebox config flow (#40938) --- homeassistant/components/freebox/config_flow.py | 2 +- homeassistant/components/freebox/strings.json | 2 +- tests/components/freebox/test_config_flow.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/freebox/config_flow.py b/homeassistant/components/freebox/config_flow.py index 0589dfb2ef1..d776c34c4f9 100644 --- a/homeassistant/components/freebox/config_flow.py +++ b/homeassistant/components/freebox/config_flow.py @@ -92,7 +92,7 @@ class FreeboxFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): except HttpRequestError: _LOGGER.error("Error connecting to the Freebox router at %s", self._host) - errors["base"] = "connection_failed" + errors["base"] = "cannot_connect" except Exception: # pylint: disable=broad-except _LOGGER.exception( diff --git a/homeassistant/components/freebox/strings.json b/homeassistant/components/freebox/strings.json index 2257e7bd908..cb48e5322de 100644 --- a/homeassistant/components/freebox/strings.json +++ b/homeassistant/components/freebox/strings.json @@ -15,7 +15,7 @@ }, "error": { "register_failed": "Failed to register, please try again", - "connection_failed": "[%key:common::config_flow::error::cannot_connect%]", + "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]", "unknown": "[%key:common::config_flow::error::unknown%]" }, "abort": { diff --git a/tests/components/freebox/test_config_flow.py b/tests/components/freebox/test_config_flow.py index a4c8a950299..addb1762df0 100644 --- a/tests/components/freebox/test_config_flow.py +++ b/tests/components/freebox/test_config_flow.py @@ -139,7 +139,7 @@ async def test_on_link_failed(hass): ): result = await hass.config_entries.flow.async_configure(result["flow_id"], {}) assert result["type"] == data_entry_flow.RESULT_TYPE_FORM - assert result["errors"] == {"base": "connection_failed"} + assert result["errors"] == {"base": "cannot_connect"} with patch( "homeassistant.components.freebox.router.Freepybox.open",