From daf3a29ae53c39e90f70b0490c1a3d6e6d0cc5f1 Mon Sep 17 00:00:00 2001 From: Guido Schmitz Date: Sat, 3 Oct 2020 21:33:33 +0200 Subject: [PATCH] Use references in config flow of devolo_home_control (#40949) --- .../components/devolo_home_control/config_flow.py | 2 +- .../components/devolo_home_control/strings.json | 12 ++++++------ .../devolo_home_control/test_config_flow.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/devolo_home_control/config_flow.py b/homeassistant/components/devolo_home_control/config_flow.py index e596a7628f6..ee11257369b 100644 --- a/homeassistant/components/devolo_home_control/config_flow.py +++ b/homeassistant/components/devolo_home_control/config_flow.py @@ -61,7 +61,7 @@ class DevoloHomeControlFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): mydevolo.credentials_valid ) if not credentials_valid: - return self._show_form({"base": "invalid_credentials"}) + return self._show_form({"base": "invalid_auth"}) _LOGGER.debug("Credentials valid") gateway_ids = await self.hass.async_add_executor_job(mydevolo.get_gateway_ids) await self.async_set_unique_id(gateway_ids[0]) diff --git a/homeassistant/components/devolo_home_control/strings.json b/homeassistant/components/devolo_home_control/strings.json index 620ca421854..8c73831a229 100644 --- a/homeassistant/components/devolo_home_control/strings.json +++ b/homeassistant/components/devolo_home_control/strings.json @@ -2,21 +2,21 @@ "title": "devolo Home Control", "config": { "abort": { - "already_configured": "This Home Control Central Unit is already in use." + "already_configured": "[%key:common::config_flow::abort::already_configured_account%]" }, "error": { - "invalid_credentials": "Incorrect user name and/or password." + "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]" }, "step": { "user": { "data": { - "username": "E-Mail-Address / devolo ID", + "username": "[%key:common::config_flow::data::email%] / devolo ID", "password": "[%key:common::config_flow::data::password%]", - "mydevolo_url": "mydevolo URL", - "home_control_url": "Home Control URL" + "mydevolo_url": "mydevolo [%key:common::config_flow::data::url%]", + "home_control_url": "Home Control [%key:common::config_flow::data::url%]" }, "title": "devolo Home Control" } } } -} \ No newline at end of file +} diff --git a/tests/components/devolo_home_control/test_config_flow.py b/tests/components/devolo_home_control/test_config_flow.py index 6790c85b777..89e87c78c64 100644 --- a/tests/components/devolo_home_control/test_config_flow.py +++ b/tests/components/devolo_home_control/test_config_flow.py @@ -66,7 +66,7 @@ async def test_form_invalid_credentials(hass): {"username": "test-username", "password": "test-password"}, ) - assert result["errors"] == {"base": "invalid_credentials"} + assert result["errors"] == {"base": "invalid_auth"} async def test_form_already_configured(hass):