Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.config_entry_oauth2_flow.OAuth2Session Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass, config_entries.ConfigEntry config_entry, AbstractOAuth2Implementation implementation)
 
None async_ensure_token_valid (self)
 
client.ClientResponse async_request (self, str method, str url, **Any kwargs)
 
dict token (self)
 
bool valid_token (self)
 

Public Attributes

 config_entry
 
 hass
 
 implementation
 

Private Attributes

 _token_lock
 

Detailed Description

Session to make requests authenticated with OAuth2.

Definition at line 497 of file config_entry_oauth2_flow.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.helpers.config_entry_oauth2_flow.OAuth2Session.__init__ (   self,
HomeAssistant  hass,
config_entries.ConfigEntry  config_entry,
AbstractOAuth2Implementation  implementation 
)
Initialize an OAuth2 session.

Definition at line 500 of file config_entry_oauth2_flow.py.

Member Function Documentation

◆ async_ensure_token_valid()

None homeassistant.helpers.config_entry_oauth2_flow.OAuth2Session.async_ensure_token_valid (   self)
Ensure that the current token is valid.

Definition at line 525 of file config_entry_oauth2_flow.py.

◆ async_request()

client.ClientResponse homeassistant.helpers.config_entry_oauth2_flow.OAuth2Session.async_request (   self,
str  method,
str  url,
**Any   kwargs 
)
Make a request.

Definition at line 537 of file config_entry_oauth2_flow.py.

◆ token()

dict homeassistant.helpers.config_entry_oauth2_flow.OAuth2Session.token (   self)
Return the token.

Definition at line 513 of file config_entry_oauth2_flow.py.

◆ valid_token()

bool homeassistant.helpers.config_entry_oauth2_flow.OAuth2Session.valid_token (   self)
Return if token is still valid.

Definition at line 518 of file config_entry_oauth2_flow.py.

Member Data Documentation

◆ _token_lock

homeassistant.helpers.config_entry_oauth2_flow.OAuth2Session._token_lock
private

Definition at line 510 of file config_entry_oauth2_flow.py.

◆ config_entry

homeassistant.helpers.config_entry_oauth2_flow.OAuth2Session.config_entry

Definition at line 508 of file config_entry_oauth2_flow.py.

◆ hass

homeassistant.helpers.config_entry_oauth2_flow.OAuth2Session.hass

Definition at line 507 of file config_entry_oauth2_flow.py.

◆ implementation

homeassistant.helpers.config_entry_oauth2_flow.OAuth2Session.implementation

Definition at line 509 of file config_entry_oauth2_flow.py.


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