From 6d1242ffe7e05ed5a5df913460a862cf70ad1841 Mon Sep 17 00:00:00 2001 From: scheric <38077357+scheric@users.noreply.github.com> Date: Wed, 14 Oct 2020 21:10:59 +0200 Subject: [PATCH] Use common strings in ovo_energy config flow (#41838) --- homeassistant/components/ovo_energy/config_flow.py | 2 +- homeassistant/components/ovo_energy/strings.json | 2 +- tests/components/ovo_energy/test_config_flow.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/ovo_energy/config_flow.py b/homeassistant/components/ovo_energy/config_flow.py index ac3e8371123..0b9b8d53f32 100644 --- a/homeassistant/components/ovo_energy/config_flow.py +++ b/homeassistant/components/ovo_energy/config_flow.py @@ -34,7 +34,7 @@ class OVOEnergyFlowHandler(ConfigFlow, domain=DOMAIN): user_input[CONF_USERNAME], user_input[CONF_PASSWORD] ) except aiohttp.ClientError: - errors["base"] = "connection_error" + errors["base"] = "cannot_connect" else: if authenticated: await self.async_set_unique_id(user_input[CONF_USERNAME]) diff --git a/homeassistant/components/ovo_energy/strings.json b/homeassistant/components/ovo_energy/strings.json index 0132f3582b6..7d08f6a847c 100644 --- a/homeassistant/components/ovo_energy/strings.json +++ b/homeassistant/components/ovo_energy/strings.json @@ -3,7 +3,7 @@ "error": { "already_configured": "[%key:common::config_flow::abort::already_configured_account%]", "authorization_error": "Authorization error. Check your credentials.", - "connection_error": "[%key:common::config_flow::error::cannot_connect%]" + "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]" }, "step": { "user": { diff --git a/tests/components/ovo_energy/test_config_flow.py b/tests/components/ovo_energy/test_config_flow.py index b89a9729c35..1c27d1e34ac 100644 --- a/tests/components/ovo_energy/test_config_flow.py +++ b/tests/components/ovo_energy/test_config_flow.py @@ -64,7 +64,7 @@ async def test_connection_error(hass: HomeAssistant) -> None: assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM assert result2["step_id"] == "user" - assert result2["errors"] == {"base": "connection_error"} + assert result2["errors"] == {"base": "cannot_connect"} async def test_full_flow_implementation(hass: HomeAssistant) -> None: