From f770fa0de0b7b7d8ee828750fdcb3230161dbd54 Mon Sep 17 00:00:00 2001 From: "Mr. Bubbles" Date: Fri, 21 Jun 2024 09:22:55 +0200 Subject: [PATCH] Fix translation key in config flow of One-Time Password (OTP) integration (#120053) --- homeassistant/components/otp/config_flow.py | 2 +- tests/components/otp/test_config_flow.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/otp/config_flow.py b/homeassistant/components/otp/config_flow.py index 7777b9b733a271..5b1551b1d04410 100644 --- a/homeassistant/components/otp/config_flow.py +++ b/homeassistant/components/otp/config_flow.py @@ -41,7 +41,7 @@ async def async_step_user( 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" diff --git a/tests/components/otp/test_config_flow.py b/tests/components/otp/test_config_flow.py index b0bd3e915bd866..c9fdcdb0fefcd8 100644 --- a/tests/components/otp/test_config_flow.py +++ b/tests/components/otp/test_config_flow.py @@ -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"), ], )