Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.cloud.google_config.CloudGoogleConfig Class Reference
Inheritance diagram for homeassistant.components.cloud.google_config.CloudGoogleConfig:
[legend]
Collaboration diagram for homeassistant.components.cloud.google_config.CloudGoogleConfig:
[legend]

Public Member Functions

None __init__ (self, HomeAssistant hass, dict[str, Any] config, str cloud_user, CloudPreferences prefs, Cloud[CloudClient] cloud)
 
str agent_user_id (self)
 
None async_connect_agent_user (self, str agent_user_id)
 
None async_disconnect_agent_user (self, str agent_user_id)
 
tuple async_get_agent_users (self)
 
None async_initialize (self)
 
None async_report_state (self, Any message, str agent_user_id, str|None event_id=None)
 
str cloud_user (self)
 
bool enabled (self)
 
dict[str, Any] entity_config (self)
 
str get_agent_user_id_from_context (self, Any context)
 
str|None get_agent_user_id_from_webhook (self, str webhook_id)
 
str get_local_user_id (self, Any webhook_id)
 
str get_local_webhook_id (self, Any agent_user_id)
 
bool has_registered_user_agent (self)
 
str|None secure_devices_pin (self)
 
bool should_2fa (self, State state)
 
bool should_expose (self, State state)
 
bool 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)
 
HTTPStatus|None async_report_state (self, dict[str, Any] message, str agent_user_id, str|None event_id=None)
 
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)
 
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)
 
bool is_local_connected (self)
 
def is_local_sdk_active (self)
 
def is_reporting_state (self)
 
def should_2fa (self, state)
 
bool should_expose (self, state)
 

Private Member Functions

bool|None _2fa_disabled_legacy (self, str entity_id)
 
None _async_exposed_entities_updated (self)
 
None _async_prefs_updated (self, CloudPreferences prefs)
 
HTTPStatus|int _async_request_sync_devices (self, str agent_user_id)
 
None _handle_device_registry_updated (self, Event[dr.EventDeviceRegistryUpdatedData] event)
 
None _handle_entity_registry_updated (self, Event[er.EventEntityRegistryUpdatedData] event)
 
None _migrate_google_entity_settings_v1 (self)
 
bool _should_expose_entity_id (self, str entity_id)
 
bool _should_expose_legacy (self, str entity_id)
 

Private Attributes

 _cloud
 
 _config
 
 _prefs
 
 _sync_entities_lock
 
 _user
 

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

HA Cloud Configuration for Google Assistant.

Definition at line 130 of file google_config.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.cloud.google_config.CloudGoogleConfig.__init__ (   self,
HomeAssistant  hass,
dict[str, Any]  config,
str  cloud_user,
CloudPreferences  prefs,
Cloud[CloudClient cloud 
)
Initialize the Google config.

Definition at line 133 of file google_config.py.

Member Function Documentation

◆ _2fa_disabled_legacy()

bool | None homeassistant.components.cloud.google_config.CloudGoogleConfig._2fa_disabled_legacy (   self,
str  entity_id 
)
private
If an entity should be checked for 2FA.

Definition at line 348 of file google_config.py.

◆ _async_exposed_entities_updated()

None homeassistant.components.cloud.google_config.CloudGoogleConfig._async_exposed_entities_updated (   self)
private
Handle updated preferences.

Definition at line 451 of file google_config.py.

◆ _async_prefs_updated()

None homeassistant.components.cloud.google_config.CloudGoogleConfig._async_prefs_updated (   self,
CloudPreferences  prefs 
)
private
Handle updated preferences.

Definition at line 411 of file google_config.py.

◆ _async_request_sync_devices()

HTTPStatus | int homeassistant.components.cloud.google_config.CloudGoogleConfig._async_request_sync_devices (   self,
str  agent_user_id 
)
private
Trigger a sync with Google.

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

Definition at line 374 of file google_config.py.

◆ _handle_device_registry_updated()

None homeassistant.components.cloud.google_config.CloudGoogleConfig._handle_device_registry_updated (   self,
Event[dr.EventDeviceRegistryUpdatedData]   event 
)
private
Handle when device registry updated.

Definition at line 481 of file google_config.py.

◆ _handle_entity_registry_updated()

None homeassistant.components.cloud.google_config.CloudGoogleConfig._handle_entity_registry_updated (   self,
Event[er.EventEntityRegistryUpdatedData]   event 
)
private
Handle when entity registry updated.

Definition at line 456 of file google_config.py.

◆ _migrate_google_entity_settings_v1()

None homeassistant.components.cloud.google_config.CloudGoogleConfig._migrate_google_entity_settings_v1 (   self)
private
Migrate Google entity settings to entity registry options.

Definition at line 190 of file google_config.py.

◆ _should_expose_entity_id()

bool homeassistant.components.cloud.google_config.CloudGoogleConfig._should_expose_entity_id (   self,
str  entity_id 
)
private
If an entity should be exposed.

Definition at line 314 of file google_config.py.

◆ _should_expose_legacy()

bool homeassistant.components.cloud.google_config.CloudGoogleConfig._should_expose_legacy (   self,
str  entity_id 
)
private
If an entity ID should be exposed.

Definition at line 282 of file google_config.py.

◆ agent_user_id()

str homeassistant.components.cloud.google_config.CloudGoogleConfig.agent_user_id (   self)
Return Agent User Id to use for query responses.

Definition at line 325 of file google_config.py.

◆ async_connect_agent_user()

None homeassistant.components.cloud.google_config.CloudGoogleConfig.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 383 of file google_config.py.

◆ async_disconnect_agent_user()

None homeassistant.components.cloud.google_config.CloudGoogleConfig.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 390 of file google_config.py.

◆ async_get_agent_users()

tuple homeassistant.components.cloud.google_config.CloudGoogleConfig.async_get_agent_users (   self)
Return known agent users.

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

Definition at line 401 of file google_config.py.

◆ async_initialize()

None homeassistant.components.cloud.google_config.CloudGoogleConfig.async_initialize (   self)
Perform async initialization of config.

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

Definition at line 215 of file google_config.py.

◆ async_report_state()

None homeassistant.components.cloud.google_config.CloudGoogleConfig.async_report_state (   self,
Any  message,
str  agent_user_id,
str | None   event_id = None 
)
Send a state report to Google.

Definition at line 365 of file google_config.py.

◆ cloud_user()

str homeassistant.components.cloud.google_config.CloudGoogleConfig.cloud_user (   self)
Return Cloud User account.

Definition at line 186 of file google_config.py.

◆ enabled()

bool homeassistant.components.cloud.google_config.CloudGoogleConfig.enabled (   self)
Return if Google is enabled.

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

Definition at line 150 of file google_config.py.

◆ entity_config()

dict[str, Any] homeassistant.components.cloud.google_config.CloudGoogleConfig.entity_config (   self)
Return entity config.

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

Definition at line 159 of file google_config.py.

◆ get_agent_user_id_from_context()

str homeassistant.components.cloud.google_config.CloudGoogleConfig.get_agent_user_id_from_context (   self,
Any  context 
)
Get agent user ID making request.

Definition at line 334 of file google_config.py.

◆ get_agent_user_id_from_webhook()

str | None homeassistant.components.cloud.google_config.CloudGoogleConfig.get_agent_user_id_from_webhook (   self,
str  webhook_id 
)
Map webhook ID to a Google agent user ID.

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

Definition at line 338 of file google_config.py.

◆ get_local_user_id()

str homeassistant.components.cloud.google_config.CloudGoogleConfig.get_local_user_id (   self,
Any  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.

Definition at line 177 of file google_config.py.

◆ get_local_webhook_id()

str homeassistant.components.cloud.google_config.CloudGoogleConfig.get_local_webhook_id (   self,
Any  agent_user_id 
)
Return the webhook ID to be used for actions for a given agent user id via the local SDK.

Definition at line 173 of file google_config.py.

◆ has_registered_user_agent()

bool homeassistant.components.cloud.google_config.CloudGoogleConfig.has_registered_user_agent (   self)
Return if we have a Agent User Id registered.

Definition at line 330 of file google_config.py.

◆ secure_devices_pin()

str | None homeassistant.components.cloud.google_config.CloudGoogleConfig.secure_devices_pin (   self)
Return entity config.

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

Definition at line 164 of file google_config.py.

◆ should_2fa()

bool homeassistant.components.cloud.google_config.CloudGoogleConfig.should_2fa (   self,
State  state 
)
If an entity should be checked for 2FA.

Definition at line 354 of file google_config.py.

◆ should_expose()

bool homeassistant.components.cloud.google_config.CloudGoogleConfig.should_expose (   self,
State  state 
)
If a state object should be exposed.

Definition at line 278 of file google_config.py.

◆ should_report_state()

bool homeassistant.components.cloud.google_config.CloudGoogleConfig.should_report_state (   self)
Return if states should be proactively reported.

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

Definition at line 169 of file google_config.py.

Member Data Documentation

◆ _cloud

homeassistant.components.cloud.google_config.CloudGoogleConfig._cloud
private

Definition at line 146 of file google_config.py.

◆ _config

homeassistant.components.cloud.google_config.CloudGoogleConfig._config
private

Definition at line 143 of file google_config.py.

◆ _prefs

homeassistant.components.cloud.google_config.CloudGoogleConfig._prefs
private

Definition at line 145 of file google_config.py.

◆ _sync_entities_lock

homeassistant.components.cloud.google_config.CloudGoogleConfig._sync_entities_lock
private

Definition at line 147 of file google_config.py.

◆ _user

homeassistant.components.cloud.google_config.CloudGoogleConfig._user
private

Definition at line 144 of file google_config.py.


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