Use common strings in esphome config flow (#41547)
This commit is contained in:
parent
a9adc2a6f0
commit
0a1d9abe79
3 changed files with 4 additions and 4 deletions
|
@ -202,6 +202,6 @@ class EsphomeFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
await cli.connect(login=True)
|
||||
except APIConnectionError:
|
||||
await cli.disconnect(force=True)
|
||||
return "invalid_password"
|
||||
return "invalid_auth"
|
||||
|
||||
return None
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"config": {
|
||||
"abort": {
|
||||
"already_configured": "ESP is already configured",
|
||||
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]",
|
||||
"already_in_progress": "[%key:common::config_flow::abort::already_in_progress%]"
|
||||
},
|
||||
"error": {
|
||||
"resolve_error": "Can't resolve address of the ESP. If this error persists, please set a static IP address: https://esphomelib.com/esphomeyaml/components/wifi.html#manual-ips",
|
||||
"connection_error": "Can't connect to ESP. Please make sure your YAML file contains an 'api:' line.",
|
||||
"invalid_password": "Invalid password!"
|
||||
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]"
|
||||
},
|
||||
"step": {
|
||||
"user": {
|
||||
|
|
|
@ -174,7 +174,7 @@ async def test_user_invalid_password(hass, mock_api_connection_error, mock_clien
|
|||
|
||||
assert result["type"] == RESULT_TYPE_FORM
|
||||
assert result["step_id"] == "authenticate"
|
||||
assert result["errors"] == {"base": "invalid_password"}
|
||||
assert result["errors"] == {"base": "invalid_auth"}
|
||||
|
||||
|
||||
async def test_discovery_initiation(hass, mock_client):
|
||||
|
|
Loading…
Add table
Reference in a new issue