diff --git a/homeassistant/components/axis/config_flow.py b/homeassistant/components/axis/config_flow.py index 5b300fe323bfad..ea1db54855b1ae 100644 --- a/homeassistant/components/axis/config_flow.py +++ b/homeassistant/components/axis/config_flow.py @@ -94,10 +94,10 @@ async def async_step_user(self, user_input=None): return await self._create_entry() except AuthenticationRequired: - errors["base"] = "faulty_credentials" + errors["base"] = "invalid_auth" except CannotConnect: - errors["base"] = "device_unavailable" + errors["base"] = "cannot_connect" data = self.discovery_schema or { vol.Required(CONF_HOST): str, diff --git a/homeassistant/components/axis/strings.json b/homeassistant/components/axis/strings.json index b98f9fe7ad1d54..046b7fee475f6e 100644 --- a/homeassistant/components/axis/strings.json +++ b/homeassistant/components/axis/strings.json @@ -13,13 +13,13 @@ } }, "error": { - "already_configured": "Device is already configured", + "already_configured": "[%key:common::config_flow::abort::already_configured_device%]", "already_in_progress": "[%key:common::config_flow::abort::already_in_progress%]", - "device_unavailable": "Device is not available", - "faulty_credentials": "Bad user credentials" + "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]", + "invalid_auth": "[%key:common::config_flow::error::invalid_auth%]" }, "abort": { - "already_configured": "Device is already configured", + "already_configured": "[%key:common::config_flow::abort::already_configured_device%]", "link_local_address": "Link local addresses are not supported", "not_axis_device": "Discovered device not an Axis device" } diff --git a/tests/components/axis/test_config_flow.py b/tests/components/axis/test_config_flow.py index e5a32c4489a296..5d9a794e3f673b 100644 --- a/tests/components/axis/test_config_flow.py +++ b/tests/components/axis/test_config_flow.py @@ -139,11 +139,11 @@ async def test_flow_fails_faulty_credentials(hass): }, ) - assert result["errors"] == {"base": "faulty_credentials"} + assert result["errors"] == {"base": "invalid_auth"} -async def test_flow_fails_device_unavailable(hass): - """Test that config flow fails on device unavailable.""" +async def test_flow_fails_cannot_connect(hass): + """Test that config flow fails on cannot connect.""" result = await hass.config_entries.flow.async_init( AXIS_DOMAIN, context={"source": "user"} ) @@ -165,7 +165,7 @@ async def test_flow_fails_device_unavailable(hass): }, ) - assert result["errors"] == {"base": "device_unavailable"} + assert result["errors"] == {"base": "cannot_connect"} async def test_flow_create_entry_multiple_existing_entries_of_same_model(hass):