Fix missing translations in tradfri (#130654)
* Fix missing translations in tradfri * Simplifypull/130669/head^2
parent
aea8e8abac
commit
e8b0b3e05c
|
@ -60,10 +60,7 @@ class FlowHandler(ConfigFlow, domain=DOMAIN):
|
|||
return await self._entry_from_data(auth)
|
||||
|
||||
except AuthError as err:
|
||||
if err.code == "invalid_security_code":
|
||||
errors[KEY_SECURITY_CODE] = err.code
|
||||
else:
|
||||
errors["base"] = err.code
|
||||
errors["base"] = err.code
|
||||
else:
|
||||
user_input = {}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
}
|
||||
},
|
||||
"error": {
|
||||
"invalid_key": "Failed to register with provided key. If this keeps happening, try restarting the gateway.",
|
||||
"invalid_security_code": "Failed to register with provided key. If this keeps happening, try restarting the gateway.",
|
||||
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
|
||||
"timeout": "Timeout validating the code.",
|
||||
"cannot_authenticate": "Cannot authenticate, is Gateway paired with another server like e.g. Homekit?"
|
||||
|
|
|
@ -86,10 +86,6 @@ async def test_user_connection_timeout(
|
|||
assert result["errors"] == {"base": "timeout"}
|
||||
|
||||
|
||||
@pytest.mark.parametrize( # Remove when translations fixed
|
||||
"ignore_translations",
|
||||
["component.tradfri.config.error.invalid_security_code"],
|
||||
)
|
||||
async def test_user_connection_bad_key(
|
||||
hass: HomeAssistant, mock_auth, mock_entry_setup
|
||||
) -> None:
|
||||
|
@ -107,7 +103,7 @@ async def test_user_connection_bad_key(
|
|||
assert len(mock_entry_setup.mock_calls) == 0
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
assert result["errors"] == {"security_code": "invalid_security_code"}
|
||||
assert result["errors"] == {"base": "invalid_security_code"}
|
||||
|
||||
|
||||
async def test_discovery_connection(
|
||||
|
|
Loading…
Reference in New Issue