From 0f2dfeb33ff45136595016f13dd6484d8d2dd25a Mon Sep 17 00:00:00 2001 From: scheric <38077357+scheric@users.noreply.github.com> Date: Fri, 16 Oct 2020 13:17:41 +0200 Subject: [PATCH] Use common strings in ovo energy config flow (#41940) --- 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 0b9b8d53f32..d9048affd04 100644 --- a/homeassistant/components/ovo_energy/config_flow.py +++ b/homeassistant/components/ovo_energy/config_flow.py @@ -49,7 +49,7 @@ class OVOEnergyFlowHandler(ConfigFlow, domain=DOMAIN): }, ) - errors["base"] = "authorization_error" + errors["base"] = "invalid_auth" return self.async_show_form( step_id="user", data_schema=USER_SCHEMA, errors=errors diff --git a/homeassistant/components/ovo_energy/strings.json b/homeassistant/components/ovo_energy/strings.json index 7d08f6a847c..fac7c97bcbe 100644 --- a/homeassistant/components/ovo_energy/strings.json +++ b/homeassistant/components/ovo_energy/strings.json @@ -2,7 +2,7 @@ "config": { "error": { "already_configured": "[%key:common::config_flow::abort::already_configured_account%]", - "authorization_error": "Authorization error. Check your credentials.", + "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]", "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]" }, "step": { diff --git a/tests/components/ovo_energy/test_config_flow.py b/tests/components/ovo_energy/test_config_flow.py index 1c27d1e34ac..58006488764 100644 --- a/tests/components/ovo_energy/test_config_flow.py +++ b/tests/components/ovo_energy/test_config_flow.py @@ -41,7 +41,7 @@ async def test_authorization_error(hass: HomeAssistant) -> None: assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM assert result2["step_id"] == "user" - assert result2["errors"] == {"base": "authorization_error"} + assert result2["errors"] == {"base": "invalid_auth"} async def test_connection_error(hass: HomeAssistant) -> None: