Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.google_assistant.http.GoogleConfig Class Reference
Inheritance diagram for homeassistant.components.google_assistant.http.GoogleConfig:
[legend]
Collaboration diagram for homeassistant.components.google_assistant.http.GoogleConfig:
[legend]

Public Member Functions

def __init__ (self, hass, config)
 
def async_call_homegraph_api (self, url, data)
 
def async_connect_agent_user (self, str agent_user_id)
 
def async_disconnect_agent_user (self, str agent_user_id)
 
def async_get_agent_users (self)
 
def async_initialize (self)
 
HTTPStatus async_report_state (self, dict[str, Any] message, str agent_user_id, str|None event_id=None)
 
def enabled (self)
 
def entity_config (self)
 
def get_agent_user_id_from_context (self, context)
 
def get_agent_user_id_from_webhook (self, webhook_id)
 
def get_local_user_id (self, webhook_id)
 
def get_local_webhook_id (self, agent_user_id)
 
def secure_devices_pin (self)
 
def should_2fa (self, state)
 
bool should_expose (self, state)
 
def should_report_state (self)
 
- Public Member Functions inherited from homeassistant.components.google_assistant.helpers.AbstractConfig
None __init__ (self, HomeAssistant hass)
 
None async_deinitialize (self)
 
None async_disable_local_sdk (self)
 
None async_disable_report_state (self)
 
None async_enable_local_sdk (self)
 
None async_enable_report_state (self)
 
def async_report_state_all (self, message)
 
def async_schedule_google_sync (self, str agent_user_id)
 
None async_schedule_google_sync_all (self)
 
def async_sync_entities (self, str agent_user_id)
 
int async_sync_entities_all (self)
 
HTTPStatus async_sync_notification (self, str agent_user_id, str event_id, dict[str, Any] payload)
 
HTTPStatus async_sync_notification_all (self, str event_id, dict[str, Any] payload)
 
bool is_local_connected (self)
 
def is_local_sdk_active (self)
 
def is_reporting_state (self)
 

Private Member Functions

HTTPStatus _async_request_sync_devices (self, str agent_user_id)
 
def _async_update_token (self, force=False)
 

Private Attributes

 _access_token
 
 _access_token_renew
 
 _config
 
 _store
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.components.google_assistant.helpers.AbstractConfig
 hass
 
- Static Public Attributes inherited from homeassistant.components.google_assistant.helpers.AbstractConfig
 None
 

Detailed Description

Config for manual setup of Google.

Definition at line 82 of file http.py.

Constructor & Destructor Documentation

◆ __init__()

def homeassistant.components.google_assistant.http.GoogleConfig.__init__ (   self,
  hass,
  config 
)
Initialize the config.

Definition at line 87 of file http.py.

Member Function Documentation

◆ _async_request_sync_devices()

HTTPStatus homeassistant.components.google_assistant.http.GoogleConfig._async_request_sync_devices (   self,
str  agent_user_id 
)
private
Trigger a sync with Google.

Return value is the HTTP status code of the sync request.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 206 of file http.py.

◆ _async_update_token()

def homeassistant.components.google_assistant.http.GoogleConfig._async_update_token (   self,
  force = False 
)
private

Definition at line 237 of file http.py.

◆ async_call_homegraph_api()

def homeassistant.components.google_assistant.http.GoogleConfig.async_call_homegraph_api (   self,
  url,
  data 
)
Call a homegraph api with authentication.

Definition at line 255 of file http.py.

◆ async_connect_agent_user()

def homeassistant.components.google_assistant.http.GoogleConfig.async_connect_agent_user (   self,
str  agent_user_id 
)
Add a synced and known agent_user_id.

Called before sending a sync response to Google.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 215 of file http.py.

◆ async_disconnect_agent_user()

def homeassistant.components.google_assistant.http.GoogleConfig.async_disconnect_agent_user (   self,
str  agent_user_id 
)
Turn off report state and disable further state reporting.

Called when:
 - The user disconnects their account from Google.
 - When the cloud configuration is initialized
 - When sync entities fails with 404

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 222 of file http.py.

◆ async_get_agent_users()

def homeassistant.components.google_assistant.http.GoogleConfig.async_get_agent_users (   self)
Return known agent users.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 233 of file http.py.

◆ async_initialize()

def homeassistant.components.google_assistant.http.GoogleConfig.async_initialize (   self)
Perform async initialization of config.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 94 of file http.py.

◆ async_report_state()

HTTPStatus homeassistant.components.google_assistant.http.GoogleConfig.async_report_state (   self,
dict[str, Any]  message,
str  agent_user_id,
str | None   event_id = None 
)
Send a state report to Google.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 290 of file http.py.

◆ enabled()

def homeassistant.components.google_assistant.http.GoogleConfig.enabled (   self)
Return if Google is enabled.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 105 of file http.py.

◆ entity_config()

def homeassistant.components.google_assistant.http.GoogleConfig.entity_config (   self)
Return entity config.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 110 of file http.py.

◆ get_agent_user_id_from_context()

def homeassistant.components.google_assistant.http.GoogleConfig.get_agent_user_id_from_context (   self,
  context 
)
Get agent user ID making request.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 148 of file http.py.

◆ get_agent_user_id_from_webhook()

def homeassistant.components.google_assistant.http.GoogleConfig.get_agent_user_id_from_webhook (   self,
  webhook_id 
)
Map webhook ID to a Google agent user ID.

Return None if no agent user id is found for the webhook_id.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 152 of file http.py.

◆ get_local_user_id()

def homeassistant.components.google_assistant.http.GoogleConfig.get_local_user_id (   self,
  webhook_id 
)
Map webhook ID to a Home Assistant user ID.

Any action initiated by Google Assistant via the local SDK will be attributed
to the returned user ID.

Return None if no user id is found for the webhook_id.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 124 of file http.py.

◆ get_local_webhook_id()

def homeassistant.components.google_assistant.http.GoogleConfig.get_local_webhook_id (   self,
  agent_user_id 
)
Return the webhook ID to be used for actions for a given agent user id via the local SDK.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 142 of file http.py.

◆ secure_devices_pin()

def homeassistant.components.google_assistant.http.GoogleConfig.secure_devices_pin (   self)
Return entity config.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 115 of file http.py.

◆ should_2fa()

def homeassistant.components.google_assistant.http.GoogleConfig.should_2fa (   self,
  state 
)
If an entity should have 2FA checked.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 202 of file http.py.

◆ should_expose()

bool homeassistant.components.google_assistant.http.GoogleConfig.should_expose (   self,
  state 
)
Return if entity should be exposed.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 163 of file http.py.

◆ should_report_state()

def homeassistant.components.google_assistant.http.GoogleConfig.should_report_state (   self)
Return if states should be proactively reported.

Reimplemented from homeassistant.components.google_assistant.helpers.AbstractConfig.

Definition at line 120 of file http.py.

Member Data Documentation

◆ _access_token

homeassistant.components.google_assistant.http.GoogleConfig._access_token
private

Definition at line 91 of file http.py.

◆ _access_token_renew

homeassistant.components.google_assistant.http.GoogleConfig._access_token_renew
private

Definition at line 92 of file http.py.

◆ _config

homeassistant.components.google_assistant.http.GoogleConfig._config
private

Definition at line 90 of file http.py.

◆ _store

homeassistant.components.google_assistant.http.GoogleConfig._store
private

Definition at line 97 of file http.py.


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