Skip to content
Snippets Groups Projects
Unverified Commit 3195ce5d authored by SNoof85's avatar SNoof85 Committed by GitHub
Browse files

Use of reference strings for Airly config flow (#40946)

parent a3b62cea
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ class AirlyFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): ...@@ -39,7 +39,7 @@ class AirlyFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
self._abort_if_unique_id_configured() self._abort_if_unique_id_configured()
api_key_valid = await self._test_api_key(websession, user_input["api_key"]) api_key_valid = await self._test_api_key(websession, user_input["api_key"])
if not api_key_valid: if not api_key_valid:
self._errors["base"] = "auth" self._errors["base"] = "invalid_api_key"
else: else:
location_valid = await self._test_location( location_valid = await self._test_location(
websession, websession,
......
...@@ -14,10 +14,10 @@ ...@@ -14,10 +14,10 @@
}, },
"error": { "error": {
"wrong_location": "No Airly measuring stations in this area.", "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": { "abort": {
"already_configured": "Airly integration for these coordinates is already configured." "already_configured": "Airly integration for these coordinates is already configured."
} }
} }
} }
\ No newline at end of file
...@@ -48,7 +48,7 @@ async def test_invalid_api_key(hass): ...@@ -48,7 +48,7 @@ async def test_invalid_api_key(hass):
DOMAIN, context={"source": SOURCE_USER}, data=CONFIG 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): async def test_invalid_location(hass):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment