Skip to content

Commit

Permalink
Fix translation key in config flow of One-Time Password (OTP) integra…
Browse files Browse the repository at this point in the history
  • Loading branch information
tr4nt0r authored Jun 21, 2024
1 parent 4aa7a9f commit f770fa0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/otp/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tests/components/otp/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
],
)
Expand Down

0 comments on commit f770fa0

Please sign in to comment.