mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Fix missing translations in tradfri (#130654)
* Fix missing translations in tradfri * Simplify
This commit is contained in:
parent
aea8e8abac
commit
e8b0b3e05c
@ -60,10 +60,7 @@ class FlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
return await self._entry_from_data(auth)
|
return await self._entry_from_data(auth)
|
||||||
|
|
||||||
except AuthError as err:
|
except AuthError as err:
|
||||||
if err.code == "invalid_security_code":
|
errors["base"] = err.code
|
||||||
errors[KEY_SECURITY_CODE] = err.code
|
|
||||||
else:
|
|
||||||
errors["base"] = err.code
|
|
||||||
else:
|
else:
|
||||||
user_input = {}
|
user_input = {}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": {
|
"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%]",
|
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
|
||||||
"timeout": "Timeout validating the code.",
|
"timeout": "Timeout validating the code.",
|
||||||
"cannot_authenticate": "Cannot authenticate, is Gateway paired with another server like e.g. Homekit?"
|
"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"}
|
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(
|
async def test_user_connection_bad_key(
|
||||||
hass: HomeAssistant, mock_auth, mock_entry_setup
|
hass: HomeAssistant, mock_auth, mock_entry_setup
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -107,7 +103,7 @@ async def test_user_connection_bad_key(
|
|||||||
assert len(mock_entry_setup.mock_calls) == 0
|
assert len(mock_entry_setup.mock_calls) == 0
|
||||||
|
|
||||||
assert result["type"] is FlowResultType.FORM
|
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(
|
async def test_discovery_connection(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user