Fix translation key in config flow of One-Time Password (OTP) integration (#120053)

This commit is contained in:
Mr. Bubbles 2024-06-21 09:22:55 +02:00 committed by GitHub
parent 4aa7a9faee
commit f770fa0de0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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"

View File

@ -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"),
], ],
) )