diff --git a/homeassistant/components/airly/config_flow.py b/homeassistant/components/airly/config_flow.py index 84bad2d3719f3f5506aad76a41d8200549814ad7..8b3b1949ec39f8fb545023dfd4c2456337ccf282 100644 --- a/homeassistant/components/airly/config_flow.py +++ b/homeassistant/components/airly/config_flow.py @@ -39,7 +39,7 @@ class AirlyFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): self._abort_if_unique_id_configured() api_key_valid = await self._test_api_key(websession, user_input["api_key"]) if not api_key_valid: - self._errors["base"] = "auth" + self._errors["base"] = "invalid_api_key" else: location_valid = await self._test_location( websession, diff --git a/homeassistant/components/airly/strings.json b/homeassistant/components/airly/strings.json index 8bf7782e91050550b13e5ba62a0c15b5491fcf10..41b58615ea8e0f3237f4db4f0a30ad0868eaab49 100644 --- a/homeassistant/components/airly/strings.json +++ b/homeassistant/components/airly/strings.json @@ -14,10 +14,10 @@ }, "error": { "wrong_location": "No Airly measuring stations in this area.", - "auth": "API key is not correct." + "invalid_api_key": "[%key:common::config_flow::error::invalid_api_key%]" }, "abort": { "already_configured": "Airly integration for these coordinates is already configured." } } -} \ No newline at end of file +} diff --git a/tests/components/airly/test_config_flow.py b/tests/components/airly/test_config_flow.py index 243a92258eb00fa11c5fa9db1f634ab4c06800b8..d7d45bbd7e3fec3ff2a2d53dc0b9895c2815cfe5 100644 --- a/tests/components/airly/test_config_flow.py +++ b/tests/components/airly/test_config_flow.py @@ -48,7 +48,7 @@ async def test_invalid_api_key(hass): DOMAIN, context={"source": SOURCE_USER}, data=CONFIG ) - assert result["errors"] == {"base": "auth"} + assert result["errors"] == {"base": "invalid_api_key"} async def test_invalid_location(hass):