mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Use reference strings in Abode (#41004)
* Use translation references * Suggested change * Remove unused string * Rename invalid_credentials key * Fix invalid_auth in manifest.json file
This commit is contained in:
parent
a3aee85335
commit
d3a0743fea
@ -47,8 +47,8 @@ class AbodeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
except (AbodeException, ConnectTimeout, HTTPError) as ex:
|
except (AbodeException, ConnectTimeout, HTTPError) as ex:
|
||||||
LOGGER.error("Unable to connect to Abode: %s", str(ex))
|
LOGGER.error("Unable to connect to Abode: %s", str(ex))
|
||||||
if ex.errcode == HTTP_BAD_REQUEST:
|
if ex.errcode == HTTP_BAD_REQUEST:
|
||||||
return self._show_form({"base": "invalid_credentials"})
|
return self._show_form({"base": "invalid_auth"})
|
||||||
return self._show_form({"base": "connection_error"})
|
return self._show_form({"base": "cannot_connect"})
|
||||||
|
|
||||||
return self.async_create_entry(
|
return self.async_create_entry(
|
||||||
title=user_input[CONF_USERNAME],
|
title=user_input[CONF_USERNAME],
|
||||||
|
@ -10,12 +10,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"identifier_exists": "Account already registered.",
|
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
|
||||||
"invalid_credentials": "Invalid credentials.",
|
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
|
||||||
"connection_error": "Unable to connect to Abode."
|
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
"single_instance_allowed": "Only a single configuration of Abode is allowed."
|
"single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -61,7 +61,7 @@ async def test_invalid_credentials(hass):
|
|||||||
side_effect=AbodeAuthenticationException((400, "auth error")),
|
side_effect=AbodeAuthenticationException((400, "auth error")),
|
||||||
):
|
):
|
||||||
result = await flow.async_step_user(user_input=conf)
|
result = await flow.async_step_user(user_input=conf)
|
||||||
assert result["errors"] == {"base": "invalid_credentials"}
|
assert result["errors"] == {"base": "invalid_auth"}
|
||||||
|
|
||||||
|
|
||||||
async def test_connection_error(hass):
|
async def test_connection_error(hass):
|
||||||
@ -78,7 +78,7 @@ async def test_connection_error(hass):
|
|||||||
),
|
),
|
||||||
):
|
):
|
||||||
result = await flow.async_step_user(user_input=conf)
|
result = await flow.async_step_user(user_input=conf)
|
||||||
assert result["errors"] == {"base": "connection_error"}
|
assert result["errors"] == {"base": "cannot_connect"}
|
||||||
|
|
||||||
|
|
||||||
async def test_step_import(hass):
|
async def test_step_import(hass):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user