diff --git a/homeassistant/components/icloud/config_flow.py b/homeassistant/components/icloud/config_flow.py index 052e5b98379..a26226a9e18 100644 --- a/homeassistant/components/icloud/config_flow.py +++ b/homeassistant/components/icloud/config_flow.py @@ -113,7 +113,7 @@ class IcloudFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): except PyiCloudFailedLoginException as error: _LOGGER.error("Error logging into iCloud service: %s", error) self.api = None - errors[CONF_USERNAME] = "login" + errors[CONF_USERNAME] = "invalid_auth" return await self._show_setup_form(user_input, errors) if self.api.requires_2sa: diff --git a/homeassistant/components/icloud/strings.json b/homeassistant/components/icloud/strings.json index 7153bb9340e..43bc204f451 100644 --- a/homeassistant/components/icloud/strings.json +++ b/homeassistant/components/icloud/strings.json @@ -26,13 +26,13 @@ } }, "error": { - "login": "Login error: please check your email & password", + "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]", "send_verification_code": "Failed to send verification code", "validate_verification_code": "Failed to verify your verification code, choose a trust device and start the verification again" }, "abort": { - "already_configured": "Account already configured", + "already_configured": "[%key:common::config_flow::abort::already_configured_account%]", "no_device": "None of your devices have \"Find my iPhone\" activated" } } -} \ No newline at end of file +} diff --git a/tests/components/icloud/test_config_flow.py b/tests/components/icloud/test_config_flow.py index 3123ead4eeb..4f70083a14a 100644 --- a/tests/components/icloud/test_config_flow.py +++ b/tests/components/icloud/test_config_flow.py @@ -275,7 +275,7 @@ async def test_login_failed(hass: HomeAssistantType): data={CONF_USERNAME: USERNAME, CONF_PASSWORD: PASSWORD}, ) assert result["type"] == data_entry_flow.RESULT_TYPE_FORM - assert result["errors"] == {CONF_USERNAME: "login"} + assert result["errors"] == {CONF_USERNAME: "invalid_auth"} async def test_no_device(