mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Use of reference strings for Airly config flow (#40946)
This commit is contained in:
parent
a3b62cea6a
commit
3195ce5d56
@ -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,
|
||||
|
@ -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."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user