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