diff --git a/homeassistant/components/neato/config_flow.py b/homeassistant/components/neato/config_flow.py index 88a2085b339..f74364bc8bc 100644 --- a/homeassistant/components/neato/config_flow.py +++ b/homeassistant/components/neato/config_flow.py @@ -105,8 +105,8 @@ class NeatoConfigFlow(config_entries.ConfigFlow, domain=NEATO_DOMAIN): try: Account(username, password, this_vendor) except NeatoLoginException: - return "invalid_credentials" + return "invalid_auth" except NeatoRobotException: - return "unexpected_error" + return "unknown" return None diff --git a/homeassistant/components/neato/strings.json b/homeassistant/components/neato/strings.json index 024a30a8e2d..5d71d4889ac 100644 --- a/homeassistant/components/neato/strings.json +++ b/homeassistant/components/neato/strings.json @@ -12,15 +12,15 @@ } }, "error": { - "invalid_credentials": "Invalid credentials", - "unexpected_error": "Unexpected error" + "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]", + "unknown": "[%key:common::config_flow::error::unknown%]" }, "create_entry": { "default": "See [Neato documentation]({docs_url})." }, "abort": { - "already_configured": "Already configured", - "invalid_credentials": "Invalid credentials" + "already_configured": "[%key:common::config_flow::abort::already_configured_device%]", + "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]" } } } \ No newline at end of file diff --git a/tests/components/neato/test_config_flow.py b/tests/components/neato/test_config_flow.py index be69e0853ad..31c2cddd09d 100644 --- a/tests/components/neato/test_config_flow.py +++ b/tests/components/neato/test_config_flow.py @@ -118,7 +118,7 @@ async def test_abort_on_invalid_credentials(hass): } ) assert result["type"] == data_entry_flow.RESULT_TYPE_FORM - assert result["errors"] == {"base": "invalid_credentials"} + assert result["errors"] == {"base": "invalid_auth"} result = await flow.async_step_import( { @@ -128,7 +128,7 @@ async def test_abort_on_invalid_credentials(hass): } ) assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT - assert result["reason"] == "invalid_credentials" + assert result["reason"] == "invalid_auth" async def test_abort_on_unexpected_error(hass): @@ -147,7 +147,7 @@ async def test_abort_on_unexpected_error(hass): } ) assert result["type"] == data_entry_flow.RESULT_TYPE_FORM - assert result["errors"] == {"base": "unexpected_error"} + assert result["errors"] == {"base": "unknown"} result = await flow.async_step_import( { @@ -157,4 +157,4 @@ async def test_abort_on_unexpected_error(hass): } ) assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT - assert result["reason"] == "unexpected_error" + assert result["reason"] == "unknown"