Public Member Functions | |
| None | __init__ (self, HomeAssistant hass) |
| def | async_connect_agent_user (self, str agent_user_id) |
| None | async_deinitialize (self) |
| None | async_disable_local_sdk (self) |
| None | async_disable_report_state (self) |
| def | async_disconnect_agent_user (self, str agent_user_id) |
| None | async_enable_local_sdk (self) |
| None | async_enable_report_state (self) |
| Collection[str] | async_get_agent_users (self) |
| None | async_initialize (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 | 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) |
| bool | is_local_connected (self) |
| def | is_local_sdk_active (self) |
| def | is_reporting_state (self) |
| def | secure_devices_pin (self) |
| def | should_2fa (self, state) |
| bool | should_expose (self, state) |
| def | should_report_state (self) |
Public Attributes | |
| hass | |
Static Public Attributes | |
| None | |
Private Member Functions | |
| int | _async_request_sync_devices (self, str agent_user_id) |
| def | _handle_local_webhook (self, hass, webhook_id, request) |
Private Attributes | |
| _local_last_active | |
| _local_sdk_active | |
| _local_sdk_version_warn | |
| _unsub_report_state | |
Hold the configuration for Google Assistant.
Definition at line 92 of file helpers.py.
| None homeassistant.components.google_assistant.helpers.AbstractConfig.__init__ | ( | self, | |
| HomeAssistant | hass | ||
| ) |
Initialize abstract config.
Definition at line 97 of file helpers.py.
|
private |
Trigger a sync with Google. Return value is the HTTP status code of the sync request.
Reimplemented in homeassistant.components.google_assistant.http.GoogleConfig, and homeassistant.components.cloud.google_config.CloudGoogleConfig.
Definition at line 298 of file helpers.py.
|
private |
Handle an incoming local SDK message.
Definition at line 395 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.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 in homeassistant.components.google_assistant.http.GoogleConfig, and homeassistant.components.cloud.google_config.CloudGoogleConfig.
Definition at line 306 of file helpers.py.
| None homeassistant.components.google_assistant.helpers.AbstractConfig.async_deinitialize | ( | self | ) |
Remove listeners.
Definition at line 119 of file helpers.py.
| None homeassistant.components.google_assistant.helpers.AbstractConfig.async_disable_local_sdk | ( | self | ) |
Disable the local SDK.
Definition at line 378 of file helpers.py.
| None homeassistant.components.google_assistant.helpers.AbstractConfig.async_disable_report_state | ( | self | ) |
Disable report state.
Definition at line 222 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.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 in homeassistant.components.google_assistant.http.GoogleConfig, and homeassistant.components.cloud.google_config.CloudGoogleConfig.
Definition at line 313 of file helpers.py.
| None homeassistant.components.google_assistant.helpers.AbstractConfig.async_enable_local_sdk | ( | self | ) |
Enable the local SDK.
Definition at line 328 of file helpers.py.
| None homeassistant.components.google_assistant.helpers.AbstractConfig.async_enable_report_state | ( | self | ) |
Enable proactive mode.
Definition at line 212 of file helpers.py.
| Collection[str] homeassistant.components.google_assistant.helpers.AbstractConfig.async_get_agent_users | ( | self | ) |
Return known agent users.
Reimplemented in homeassistant.components.google_assistant.http.GoogleConfig, and homeassistant.components.cloud.google_config.CloudGoogleConfig.
Definition at line 324 of file helpers.py.
| None homeassistant.components.google_assistant.helpers.AbstractConfig.async_initialize | ( | self | ) |
Perform async initialization of config.
Reimplemented in homeassistant.components.google_assistant.http.GoogleConfig, and homeassistant.components.cloud.google_config.CloudGoogleConfig.
Definition at line 107 of file helpers.py.
| HTTPStatus | None homeassistant.components.google_assistant.helpers.AbstractConfig.async_report_state | ( | self, | |
| dict[str, Any] | message, | ||
| str | agent_user_id, | ||
| str | None | event_id = None |
||
| ) |
Send a state report to Google.
Reimplemented in homeassistant.components.google_assistant.http.GoogleConfig.
Definition at line 198 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.async_report_state_all | ( | self, | |
| message | |||
| ) |
Send a state report to Google for all previously synced users.
Definition at line 203 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.async_schedule_google_sync | ( | self, | |
| str | agent_user_id | ||
| ) |
Schedule a sync.
Definition at line 278 of file helpers.py.
| None homeassistant.components.google_assistant.helpers.AbstractConfig.async_schedule_google_sync_all | ( | self | ) |
Schedule a sync for all registered agents.
Definition at line 293 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.async_sync_entities | ( | self, | |
| str | agent_user_id | ||
| ) |
Sync all entities to Google.
Definition at line 228 of file helpers.py.
| int homeassistant.components.google_assistant.helpers.AbstractConfig.async_sync_entities_all | ( | self | ) |
Sync all entities to Google for all registered agents.
Definition at line 237 of file helpers.py.
| HTTPStatus homeassistant.components.google_assistant.helpers.AbstractConfig.async_sync_notification | ( | self, | |
| str | agent_user_id, | ||
| str | event_id, | ||
| dict[str, Any] | payload | ||
| ) |
Sync notifications to Google.
Definition at line 250 of file helpers.py.
| HTTPStatus homeassistant.components.google_assistant.helpers.AbstractConfig.async_sync_notification_all | ( | self, | |
| str | event_id, | ||
| dict[str, Any] | payload | ||
| ) |
Sync notification to Google for all registered agents.
Definition at line 262 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.enabled | ( | self | ) |
Return if Google is enabled.
Reimplemented in homeassistant.components.google_assistant.http.GoogleConfig, and homeassistant.components.cloud.google_config.CloudGoogleConfig.
Definition at line 127 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.entity_config | ( | self | ) |
Return entity config.
Reimplemented in homeassistant.components.google_assistant.http.GoogleConfig, and homeassistant.components.cloud.google_config.CloudGoogleConfig.
Definition at line 132 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.get_agent_user_id_from_context | ( | self, | |
| context | |||
| ) |
Get agent user ID from context.
Reimplemented in homeassistant.components.google_assistant.http.GoogleConfig.
Definition at line 179 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.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 in homeassistant.components.google_assistant.http.GoogleConfig.
Definition at line 183 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.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 in homeassistant.components.google_assistant.http.GoogleConfig.
Definition at line 165 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.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 in homeassistant.components.google_assistant.http.GoogleConfig.
Definition at line 175 of file helpers.py.
| bool homeassistant.components.google_assistant.helpers.AbstractConfig.is_local_connected | ( | self | ) |
Return if local is connected.
Definition at line 156 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.is_local_sdk_active | ( | self | ) |
Return if we're actively accepting local messages.
Definition at line 146 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.is_reporting_state | ( | self | ) |
Return if we're actively reporting states.
Definition at line 141 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.secure_devices_pin | ( | self | ) |
Return entity config.
Reimplemented in homeassistant.components.google_assistant.http.GoogleConfig, and homeassistant.components.cloud.google_config.CloudGoogleConfig.
Definition at line 137 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.should_2fa | ( | self, | |
| state | |||
| ) |
If an entity should have 2FA checked.
Reimplemented in homeassistant.components.google_assistant.http.GoogleConfig.
Definition at line 194 of file helpers.py.
| bool homeassistant.components.google_assistant.helpers.AbstractConfig.should_expose | ( | self, | |
| state | |||
| ) |
Return if entity should be exposed.
Reimplemented in homeassistant.components.google_assistant.http.GoogleConfig.
Definition at line 190 of file helpers.py.
| def homeassistant.components.google_assistant.helpers.AbstractConfig.should_report_state | ( | self | ) |
Return if states should be proactively reported.
Reimplemented in homeassistant.components.google_assistant.http.GoogleConfig, and homeassistant.components.cloud.google_config.CloudGoogleConfig.
Definition at line 152 of file helpers.py.
|
private |
Definition at line 401 of file helpers.py.
|
private |
Definition at line 101 of file helpers.py.
|
private |
Definition at line 103 of file helpers.py.
|
private |
Definition at line 219 of file helpers.py.
| homeassistant.components.google_assistant.helpers.AbstractConfig.hass |
Definition at line 99 of file helpers.py.
|
static |
Definition at line 95 of file helpers.py.