diff --git a/homeassistant/components/tesla/config_flow.py b/homeassistant/components/tesla/config_flow.py index f21c8c76e23..fb7de78f507 100644 --- a/homeassistant/components/tesla/config_flow.py +++ b/homeassistant/components/tesla/config_flow.py @@ -62,7 +62,7 @@ class TeslaConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): return self.async_show_form( step_id="user", data_schema=DATA_SCHEMA, - errors={CONF_USERNAME: "identifier_exists"}, + errors={CONF_USERNAME: "already_configured_account"}, description_placeholders={}, ) @@ -72,14 +72,14 @@ class TeslaConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): return self.async_show_form( step_id="user", data_schema=DATA_SCHEMA, - errors={"base": "connection_error"}, + errors={"base": "cannot_connect"}, description_placeholders={}, ) except InvalidAuth: return self.async_show_form( step_id="user", data_schema=DATA_SCHEMA, - errors={"base": "invalid_credentials"}, + errors={"base": "invalid_auth"}, description_placeholders={}, ) return self.async_create_entry(title=user_input[CONF_USERNAME], data=info) diff --git a/homeassistant/components/tesla/strings.json b/homeassistant/components/tesla/strings.json index fb3c11a276f..f174b5fc6de 100644 --- a/homeassistant/components/tesla/strings.json +++ b/homeassistant/components/tesla/strings.json @@ -1,10 +1,9 @@ { "config": { "error": { - "connection_error": "Error connecting; check network and retry", - "identifier_exists": "Email already registered", - "invalid_credentials": "Invalid credentials", - "unknown_error": "Unknown error, please report log info" + "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]", + "already_configured_account": "[%key:common::config_flow::abort::already_configured_account%]", + "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]" }, "step": { "user": { @@ -27,4 +26,4 @@ } } } -} \ No newline at end of file +} diff --git a/tests/components/tesla/test_config_flow.py b/tests/components/tesla/test_config_flow.py index a59daee9ac6..321f352e28d 100644 --- a/tests/components/tesla/test_config_flow.py +++ b/tests/components/tesla/test_config_flow.py @@ -70,7 +70,7 @@ async def test_form_invalid_auth(hass): ) assert result2["type"] == "form" - assert result2["errors"] == {"base": "invalid_credentials"} + assert result2["errors"] == {"base": "invalid_auth"} async def test_form_cannot_connect(hass): @@ -89,7 +89,7 @@ async def test_form_cannot_connect(hass): ) assert result2["type"] == "form" - assert result2["errors"] == {"base": "connection_error"} + assert result2["errors"] == {"base": "cannot_connect"} async def test_form_repeat_identifier(hass): @@ -110,7 +110,7 @@ async def test_form_repeat_identifier(hass): ) assert result2["type"] == "form" - assert result2["errors"] == {CONF_USERNAME: "identifier_exists"} + assert result2["errors"] == {CONF_USERNAME: "already_configured_account"} async def test_import(hass):