Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.alexa.auth.Auth Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass, str client_id, str client_secret)
 
str|None async_do_auth (self, str accept_grant_code)
 
str|None async_get_access_token (self)
 
None async_invalidate_access_token (self)
 
None async_load_preferences (self)
 
bool is_token_valid (self)
 

Public Attributes

 client_id
 
 client_secret
 
 hass
 

Private Member Functions

str|None _async_request_new_token (self, dict[str, str] lwa_params)
 
None _async_update_preferences (self, str access_token, str refresh_token, str expire_time)
 

Private Attributes

 _get_token_lock
 
 _prefs
 

Detailed Description

Handle authentication to send events to Alexa.

Definition at line 33 of file auth.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.alexa.auth.Auth.__init__ (   self,
HomeAssistant  hass,
str  client_id,
str  client_secret 
)
Initialize the Auth class.

Definition at line 36 of file auth.py.

Member Function Documentation

◆ _async_request_new_token()

str | None homeassistant.components.alexa.auth.Auth._async_request_new_token (   self,
dict[str, str]  lwa_params 
)
private

Definition at line 115 of file auth.py.

◆ _async_update_preferences()

None homeassistant.components.alexa.auth.Auth._async_update_preferences (   self,
str  access_token,
str  refresh_token,
str   expire_time 
)
private
Update user preferences.

Definition at line 162 of file auth.py.

◆ async_do_auth()

str | None homeassistant.components.alexa.auth.Auth.async_do_auth (   self,
str  accept_grant_code 
)
Do authentication with an AcceptGrant code.

Definition at line 48 of file auth.py.

◆ async_get_access_token()

str | None homeassistant.components.alexa.auth.Auth.async_get_access_token (   self)
Perform access token or token refresh request.

Definition at line 72 of file auth.py.

◆ async_invalidate_access_token()

None homeassistant.components.alexa.auth.Auth.async_invalidate_access_token (   self)
Invalidate access token.

Definition at line 67 of file auth.py.

◆ async_load_preferences()

None homeassistant.components.alexa.auth.Auth.async_load_preferences (   self)
Load preferences with stored tokens.

Definition at line 151 of file auth.py.

◆ is_token_valid()

bool homeassistant.components.alexa.auth.Auth.is_token_valid (   self)
Check if a token is already loaded and if it is still valid.

Definition at line 99 of file auth.py.

Member Data Documentation

◆ _get_token_lock

homeassistant.components.alexa.auth.Auth._get_token_lock
private

Definition at line 46 of file auth.py.

◆ _prefs

homeassistant.components.alexa.auth.Auth._prefs
private

Definition at line 153 of file auth.py.

◆ client_id

homeassistant.components.alexa.auth.Auth.client_id

Definition at line 40 of file auth.py.

◆ client_secret

homeassistant.components.alexa.auth.Auth.client_secret

Definition at line 41 of file auth.py.

◆ hass

homeassistant.components.alexa.auth.Auth.hass

Definition at line 38 of file auth.py.


The documentation for this class was generated from the following file: