From b7ff0a5a49478c67525d6b3578699c9e1a0cedbf Mon Sep 17 00:00:00 2001 From: SNoof85 Date: Mon, 5 Oct 2020 15:29:27 +0200 Subject: [PATCH] Use reference strings in rainmachine (#41216) --- homeassistant/components/rainmachine/config_flow.py | 2 +- homeassistant/components/rainmachine/strings.json | 8 ++++---- tests/components/rainmachine/test_config_flow.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/rainmachine/config_flow.py b/homeassistant/components/rainmachine/config_flow.py index d0513ac89fb..b6e429f2e83 100644 --- a/homeassistant/components/rainmachine/config_flow.py +++ b/homeassistant/components/rainmachine/config_flow.py @@ -69,7 +69,7 @@ class RainMachineFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): ssl=user_input.get(CONF_SSL, True), ) except RainMachineError: - return await self._show_form({CONF_PASSWORD: "invalid_credentials"}) + return await self._show_form({CONF_PASSWORD: "invalid_auth"}) # Unfortunately, RainMachine doesn't provide a way to refresh the # access token without using the IP address and password, so we have to diff --git a/homeassistant/components/rainmachine/strings.json b/homeassistant/components/rainmachine/strings.json index 555230d1f0f..916114053cc 100644 --- a/homeassistant/components/rainmachine/strings.json +++ b/homeassistant/components/rainmachine/strings.json @@ -11,11 +11,11 @@ } }, "error": { - "identifier_exists": "Account already registered", - "invalid_credentials": "Invalid credentials" + "identifier_exists": "[%key:common::config_flow::abort::already_configured_account%]", + "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]" }, "abort": { - "already_configured": "This RainMachine controller is already configured." + "already_configured": "[%key:common::config_flow::abort::already_configured_device%]" } } -} \ No newline at end of file +} diff --git a/tests/components/rainmachine/test_config_flow.py b/tests/components/rainmachine/test_config_flow.py index be4a5fd20fe..28de0da39fa 100644 --- a/tests/components/rainmachine/test_config_flow.py +++ b/tests/components/rainmachine/test_config_flow.py @@ -54,7 +54,7 @@ async def test_invalid_password(hass): side_effect=RainMachineError, ): result = await flow.async_step_user(user_input=conf) - assert result["errors"] == {CONF_PASSWORD: "invalid_credentials"} + assert result["errors"] == {CONF_PASSWORD: "invalid_auth"} async def test_show_form(hass):