mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix translation key in config flow of One-Time Password (OTP) integration (#120053)
This commit is contained in:
parent
4aa7a9faee
commit
f770fa0de0
@ -41,7 +41,7 @@ class TOTPConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
pyotp.TOTP(user_input[CONF_TOKEN]).now
|
pyotp.TOTP(user_input[CONF_TOKEN]).now
|
||||||
)
|
)
|
||||||
except binascii.Error:
|
except binascii.Error:
|
||||||
errors["base"] = "invalid_code"
|
errors["base"] = "invalid_token"
|
||||||
except Exception:
|
except Exception:
|
||||||
_LOGGER.exception("Unexpected exception")
|
_LOGGER.exception("Unexpected exception")
|
||||||
errors["base"] = "unknown"
|
errors["base"] = "unknown"
|
||||||
|
@ -42,7 +42,7 @@ async def test_form(hass: HomeAssistant, mock_setup_entry: AsyncMock) -> None:
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
("exception", "error"),
|
("exception", "error"),
|
||||||
[
|
[
|
||||||
(binascii.Error, "invalid_code"),
|
(binascii.Error, "invalid_token"),
|
||||||
(IndexError, "unknown"),
|
(IndexError, "unknown"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user