Home Assistant Unofficial Reference 2024.12.1
homeassistant.auth.mfa_modules.notify Namespace Reference

Classes

class  NotifyAuthModule
 
class  NotifySetting
 
class  NotifySetupFlow
 

Functions

str _generate_otp (str secret, int count)
 
int _generate_random ()
 
str _generate_secret ()
 
bool _verify_otp (str secret, str otp, int count)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 _UsersDict
 
string CONF_MESSAGE = "message"
 
 CONFIG_SCHEMA
 
string INPUT_FIELD_CODE = "code"
 
list REQUIREMENTS = ["pyotp==2.8.0"]
 
string STORAGE_KEY = "auth_module.notify"
 
string STORAGE_USER_ID = "user_id"
 
string STORAGE_USERS = "users"
 
int STORAGE_VERSION = 1
 

Detailed Description

HMAC-based One-time Password auth module.

Sending HOTP through notify service

Function Documentation

◆ _generate_otp()

str homeassistant.auth.mfa_modules.notify._generate_otp ( str  secret,
int  count 
)
private
Generate one time password.

Definition at line 67 of file notify.py.

◆ _generate_random()

int homeassistant.auth.mfa_modules.notify._generate_random ( )
private
Generate a 32 digit number.

Definition at line 60 of file notify.py.

◆ _generate_secret()

str homeassistant.auth.mfa_modules.notify._generate_secret ( )
private
Generate a secret.

Definition at line 53 of file notify.py.

◆ _verify_otp()

bool homeassistant.auth.mfa_modules.notify._verify_otp ( str  secret,
str  otp,
int  count 
)
private
Verify one time password.

Definition at line 74 of file notify.py.

Variable Documentation

◆ _LOGGER

homeassistant.auth.mfa_modules.notify._LOGGER = logging.getLogger(__name__)
private

Definition at line 50 of file notify.py.

◆ _UsersDict

homeassistant.auth.mfa_modules.notify._UsersDict
private

Definition at line 91 of file notify.py.

◆ CONF_MESSAGE

string homeassistant.auth.mfa_modules.notify.CONF_MESSAGE = "message"

Definition at line 32 of file notify.py.

◆ CONFIG_SCHEMA

homeassistant.auth.mfa_modules.notify.CONFIG_SCHEMA
Initial value:
1 = MULTI_FACTOR_AUTH_MODULE_SCHEMA.extend(
2  {
3  vol.Optional(CONF_INCLUDE): vol.All(cv.ensure_list, [cv.string]),
4  vol.Optional(CONF_EXCLUDE): vol.All(cv.ensure_list, [cv.string]),
5  vol.Optional(CONF_MESSAGE, default="{} is your Home Assistant login code"): str,
6  },
7  extra=vol.PREVENT_EXTRA,
8 )

Definition at line 34 of file notify.py.

◆ INPUT_FIELD_CODE

string homeassistant.auth.mfa_modules.notify.INPUT_FIELD_CODE = "code"

Definition at line 48 of file notify.py.

◆ REQUIREMENTS

list homeassistant.auth.mfa_modules.notify.REQUIREMENTS = ["pyotp==2.8.0"]

Definition at line 30 of file notify.py.

◆ STORAGE_KEY

string homeassistant.auth.mfa_modules.notify.STORAGE_KEY = "auth_module.notify"

Definition at line 44 of file notify.py.

◆ STORAGE_USER_ID

string homeassistant.auth.mfa_modules.notify.STORAGE_USER_ID = "user_id"

Definition at line 46 of file notify.py.

◆ STORAGE_USERS

string homeassistant.auth.mfa_modules.notify.STORAGE_USERS = "users"

Definition at line 45 of file notify.py.

◆ STORAGE_VERSION

int homeassistant.auth.mfa_modules.notify.STORAGE_VERSION = 1

Definition at line 43 of file notify.py.