Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.google.api.DeviceFlow Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass, OAuth2WebServerFlow oauth_flow, DeviceFlowInfo device_flow_info)
 
None async_set_listener (self, CALLBACK_TYPE update_callback)
 
None async_start_exchange (self)
 
Credentials|None creds (self)
 
str user_code (self)
 
str verification_url (self)
 

Private Member Functions

None _async_poll_attempt (self, datetime.datetime now)
 
None _async_timeout (self, datetime.datetime now)
 
Credentials _exchange (self)
 
None _finish (self)
 

Private Attributes

 _creds
 
 _exchange_task_unsub
 
 _hass
 
 _listener
 
 _oauth_flow
 
 _timeout_unsub
 

Detailed Description

OAuth2 device flow for exchanging a code for an access token.

Definition at line 68 of file api.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.google.api.DeviceFlow.__init__ (   self,
HomeAssistant  hass,
OAuth2WebServerFlow  oauth_flow,
DeviceFlowInfo  device_flow_info 
)
Initialize DeviceFlow.

Definition at line 71 of file api.py.

Member Function Documentation

◆ _async_poll_attempt()

None homeassistant.components.google.api.DeviceFlow._async_poll_attempt (   self,
datetime.datetime  now 
)
private

Definition at line 131 of file api.py.

◆ _async_timeout()

None homeassistant.components.google.api.DeviceFlow._async_timeout (   self,
datetime.datetime  now 
)
private

Definition at line 144 of file api.py.

◆ _exchange()

Credentials homeassistant.components.google.api.DeviceFlow._exchange (   self)
private

Definition at line 140 of file api.py.

◆ _finish()

None homeassistant.components.google.api.DeviceFlow._finish (   self)
private

Definition at line 149 of file api.py.

◆ async_set_listener()

None homeassistant.components.google.api.DeviceFlow.async_set_listener (   self,
CALLBACK_TYPE  update_callback 
)
Invoke the update callback when the exchange finishes or on timeout.

Definition at line 97 of file api.py.

◆ async_start_exchange()

None homeassistant.components.google.api.DeviceFlow.async_start_exchange (   self)
Start the device auth exchange flow polling.

Definition at line 109 of file api.py.

◆ creds()

Credentials | None homeassistant.components.google.api.DeviceFlow.creds (   self)
Return result of exchange step or None on timeout.

Definition at line 105 of file api.py.

◆ user_code()

str homeassistant.components.google.api.DeviceFlow.user_code (   self)
Return the code that the user should enter at the verification url.

Definition at line 92 of file api.py.

◆ verification_url()

str homeassistant.components.google.api.DeviceFlow.verification_url (   self)
Return the verification url that the user should visit to enter the code.

Definition at line 87 of file api.py.

Member Data Documentation

◆ _creds

homeassistant.components.google.api.DeviceFlow._creds
private

Definition at line 134 of file api.py.

◆ _exchange_task_unsub

homeassistant.components.google.api.DeviceFlow._exchange_task_unsub
private

Definition at line 122 of file api.py.

◆ _hass

homeassistant.components.google.api.DeviceFlow._hass
private

Definition at line 78 of file api.py.

◆ _listener

homeassistant.components.google.api.DeviceFlow._listener
private

Definition at line 102 of file api.py.

◆ _oauth_flow

homeassistant.components.google.api.DeviceFlow._oauth_flow
private

Definition at line 79 of file api.py.

◆ _timeout_unsub

homeassistant.components.google.api.DeviceFlow._timeout_unsub
private

Definition at line 127 of file api.py.


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