diff --git a/homeassistant/auth/mfa_modules/notify.py b/homeassistant/auth/mfa_modules/notify.py index 12e80ae47b0..0f53ddc900d 100644 --- a/homeassistant/auth/mfa_modules/notify.py +++ b/homeassistant/auth/mfa_modules/notify.py @@ -25,7 +25,7 @@ from . import ( SetupFlow, ) -REQUIREMENTS = ["pyotp==2.3.0"] +REQUIREMENTS = ["pyotp==2.6.0"] CONF_MESSAGE = "message" @@ -56,10 +56,10 @@ def _generate_secret() -> str: def _generate_random() -> int: - """Generate a 8 digit number.""" + """Generate a 32 digit number.""" import pyotp # pylint: disable=import-outside-toplevel - return int(pyotp.random_base32(length=8, chars=list("1234567890"))) + return int(pyotp.random_base32(length=32, chars=list("1234567890"))) def _generate_otp(secret: str, count: int) -> str: diff --git a/homeassistant/auth/mfa_modules/totp.py b/homeassistant/auth/mfa_modules/totp.py index 0ff7e1147b1..e0e2b9522d9 100644 --- a/homeassistant/auth/mfa_modules/totp.py +++ b/homeassistant/auth/mfa_modules/totp.py @@ -18,7 +18,7 @@ from . import ( SetupFlow, ) -REQUIREMENTS = ["pyotp==2.3.0", "PyQRCode==1.2.1"] +REQUIREMENTS = ["pyotp==2.6.0", "PyQRCode==1.2.1"] CONFIG_SCHEMA = MULTI_FACTOR_AUTH_MODULE_SCHEMA.extend({}, extra=vol.PREVENT_EXTRA) @@ -181,7 +181,7 @@ class TotpSetupFlow(SetupFlow): # to fix typing complaint self._auth_module: TotpAuthModule = auth_module self._user = user - self._ota_secret: str | None = None + self._ota_secret: str = "" self._url = None # type Optional[str] self._image = None # type Optional[str] diff --git a/homeassistant/components/otp/manifest.json b/homeassistant/components/otp/manifest.json index 9b8b4527b2c..14205b8652d 100644 --- a/homeassistant/components/otp/manifest.json +++ b/homeassistant/components/otp/manifest.json @@ -2,7 +2,7 @@ "domain": "otp", "name": "One-Time Password (OTP)", "documentation": "https://www.home-assistant.io/integrations/otp", - "requirements": ["pyotp==2.3.0"], + "requirements": ["pyotp==2.6.0"], "codeowners": [], "quality_scale": "internal", "iot_class": "local_polling" diff --git a/requirements_all.txt b/requirements_all.txt index 16084510e96..e1881b2ad7e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1699,7 +1699,7 @@ pyotgw==1.1b1 # homeassistant.auth.mfa_modules.notify # homeassistant.auth.mfa_modules.totp # homeassistant.components.otp -pyotp==2.3.0 +pyotp==2.6.0 # homeassistant.components.openweathermap pyowm==3.2.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index e2628d00576..088a140ffe3 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1024,7 +1024,7 @@ pyotgw==1.1b1 # homeassistant.auth.mfa_modules.notify # homeassistant.auth.mfa_modules.totp # homeassistant.components.otp -pyotp==2.3.0 +pyotp==2.6.0 # homeassistant.components.openweathermap pyowm==3.2.0