Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.cloud.prefs.CloudPreferences Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass)
 
list[str]|None alexa_default_expose (self)
 
bool alexa_enabled (self)
 
dict[str, Any] alexa_entity_configs (self)
 
bool alexa_report_state (self)
 
int alexa_settings_version (self)
 
dict[str, Any] as_dict (self)
 
None async_erase_config (self)
 
None async_initialize (self)
 
Callable[[], None] async_listen_updates (self, Callable[[CloudPreferences], Coroutine[Any, Any, None]] listener)
 
bool async_set_username (self, str|None username)
 
None async_update (self, *bool|UndefinedType alexa_enabled=UNDEFINED, bool|UndefinedType alexa_report_state=UNDEFINED, int|UndefinedType alexa_settings_version=UNDEFINED, bool|UndefinedType cloud_ice_servers_enabled=UNDEFINED, str|UndefinedType cloud_user=UNDEFINED, dict[str, dict[str, str|bool]]|UndefinedType cloudhooks=UNDEFINED, bool|UndefinedType google_connected=UNDEFINED, bool|UndefinedType google_enabled=UNDEFINED, bool|UndefinedType google_report_state=UNDEFINED, str|None|UndefinedType google_secure_devices_pin=UNDEFINED, int|UndefinedType google_settings_version=UNDEFINED, bool|UndefinedType remote_allow_remote_enable=UNDEFINED, str|None|UndefinedType remote_domain=UNDEFINED, bool|UndefinedType remote_enabled=UNDEFINED, tuple[str, str]|UndefinedType tts_default_voice=UNDEFINED)
 
bool cloud_ice_servers_enabled (self)
 
dict[str, Any] cloudhooks (self)
 
str get_cloud_user (self)
 
bool google_connected (self)
 
list[str]|None google_default_expose (self)
 
bool google_enabled (self)
 
dict[str, dict[str, Any]] google_entity_configs (self)
 
str google_local_webhook_id (self)
 
bool google_report_state (self)
 
str|None google_secure_devices_pin (self)
 
int google_settings_version (self)
 
str|None instance_id (self)
 
bool remote_allow_remote_enable (self)
 
str|None remote_domain (self)
 
bool remote_enabled (self)
 
tuple[str, str] tts_default_voice (self)
 

Public Attributes

 last_updated
 

Private Member Functions

User|None _load_cloud_user (self)
 
None _save_prefs (self, dict[str, Any] prefs)
 

Static Private Member Functions

dict[str, Any] _empty_config (str username)
 

Private Attributes

 _hass
 
 _prefs
 
 _store
 

Detailed Description

Handle cloud preferences.

Definition at line 110 of file prefs.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.cloud.prefs.CloudPreferences.__init__ (   self,
HomeAssistant  hass 
)
Initialize cloud prefs.

Definition at line 115 of file prefs.py.

Member Function Documentation

◆ _empty_config()

dict[str, Any] homeassistant.components.cloud.prefs.CloudPreferences._empty_config ( str  username)
staticprivate
Return an empty config.

Definition at line 413 of file prefs.py.

◆ _load_cloud_user()

User | None homeassistant.components.cloud.prefs.CloudPreferences._load_cloud_user (   self)
private
Load cloud user if available.

Definition at line 391 of file prefs.py.

◆ _save_prefs()

None homeassistant.components.cloud.prefs.CloudPreferences._save_prefs (   self,
dict[str, Any]  prefs 
)
private
Save preferences to disk.

Definition at line 400 of file prefs.py.

◆ alexa_default_expose()

list[str] | None homeassistant.components.cloud.prefs.CloudPreferences.alexa_default_expose (   self)
Return array of entity domains that are exposed by default to Alexa.

Can return None, in which case for backwards should be interpreted as allow all domains.

Definition at line 286 of file prefs.py.

◆ alexa_enabled()

bool homeassistant.components.cloud.prefs.CloudPreferences.alexa_enabled (   self)
Return if Alexa is enabled.

Definition at line 275 of file prefs.py.

◆ alexa_entity_configs()

dict[str, Any] homeassistant.components.cloud.prefs.CloudPreferences.alexa_entity_configs (   self)
Return Alexa Entity configurations.

Definition at line 294 of file prefs.py.

◆ alexa_report_state()

bool homeassistant.components.cloud.prefs.CloudPreferences.alexa_report_state (   self)
Return if Alexa report state is enabled.

Definition at line 281 of file prefs.py.

◆ alexa_settings_version()

int homeassistant.components.cloud.prefs.CloudPreferences.alexa_settings_version (   self)
Return version of Alexa settings.

Definition at line 299 of file prefs.py.

◆ as_dict()

dict[str, Any] homeassistant.components.cloud.prefs.CloudPreferences.as_dict (   self)
Return dictionary version.

Definition at line 238 of file prefs.py.

◆ async_erase_config()

None homeassistant.components.cloud.prefs.CloudPreferences.async_erase_config (   self)
Erase the configuration.

Definition at line 234 of file prefs.py.

◆ async_initialize()

None homeassistant.components.cloud.prefs.CloudPreferences.async_initialize (   self)
Finish initializing the preferences.

Definition at line 126 of file prefs.py.

◆ async_listen_updates()

Callable[[], None] homeassistant.components.cloud.prefs.CloudPreferences.async_listen_updates (   self,
Callable[[CloudPreferences], Coroutine[Any, Any, None]]   listener 
)
Listen for updates to the preferences.

Definition at line 149 of file prefs.py.

◆ async_set_username()

bool homeassistant.components.cloud.prefs.CloudPreferences.async_set_username (   self,
str | None  username 
)
Set the username that is logged in.

Definition at line 211 of file prefs.py.

◆ async_update()

None homeassistant.components.cloud.prefs.CloudPreferences.async_update (   self,
*bool | UndefinedType   alexa_enabled = UNDEFINED,
bool | UndefinedType   alexa_report_state = UNDEFINED,
int | UndefinedType   alexa_settings_version = UNDEFINED,
bool | UndefinedType   cloud_ice_servers_enabled = UNDEFINED,
str | UndefinedType   cloud_user = UNDEFINED,
dict[str, dict[str, str | bool]] | UndefinedType   cloudhooks = UNDEFINED,
bool | UndefinedType   google_connected = UNDEFINED,
bool | UndefinedType   google_enabled = UNDEFINED,
bool | UndefinedType   google_report_state = UNDEFINED,
str | None | UndefinedType   google_secure_devices_pin = UNDEFINED,
int | UndefinedType   google_settings_version = UNDEFINED,
bool | UndefinedType   remote_allow_remote_enable = UNDEFINED,
str | None | UndefinedType   remote_domain = UNDEFINED,
bool | UndefinedType   remote_enabled = UNDEFINED,
tuple[str, str] | UndefinedType   tts_default_voice = UNDEFINED 
)
Update user preferences.

Definition at line 163 of file prefs.py.

◆ cloud_ice_servers_enabled()

bool homeassistant.components.cloud.prefs.CloudPreferences.cloud_ice_servers_enabled (   self)
Return if cloud ICE servers are enabled.

Definition at line 370 of file prefs.py.

◆ cloudhooks()

dict[str, Any] homeassistant.components.cloud.prefs.CloudPreferences.cloudhooks (   self)
Return the published cloud webhooks.

Definition at line 352 of file prefs.py.

◆ get_cloud_user()

str homeassistant.components.cloud.prefs.CloudPreferences.get_cloud_user (   self)
Return ID of Home Assistant Cloud system user.

Definition at line 377 of file prefs.py.

◆ google_connected()

bool homeassistant.components.cloud.prefs.CloudPreferences.google_connected (   self)
Return if Google is connected.

Definition at line 311 of file prefs.py.

◆ google_default_expose()

list[str] | None homeassistant.components.cloud.prefs.CloudPreferences.google_default_expose (   self)
Return array of entity domains that are exposed by default to Google.

Can return None, in which case for backwards should be interpreted as allow all domains.

Definition at line 344 of file prefs.py.

◆ google_enabled()

bool homeassistant.components.cloud.prefs.CloudPreferences.google_enabled (   self)
Return if Google is enabled.

Definition at line 305 of file prefs.py.

◆ google_entity_configs()

dict[str, dict[str, Any]] homeassistant.components.cloud.prefs.CloudPreferences.google_entity_configs (   self)
Return Google Entity configurations.

Definition at line 327 of file prefs.py.

◆ google_local_webhook_id()

str homeassistant.components.cloud.prefs.CloudPreferences.google_local_webhook_id (   self)
Return Google webhook ID to receive local messages.

Definition at line 338 of file prefs.py.

◆ google_report_state()

bool homeassistant.components.cloud.prefs.CloudPreferences.google_report_state (   self)
Return if Google report state is enabled.

Definition at line 317 of file prefs.py.

◆ google_secure_devices_pin()

str | None homeassistant.components.cloud.prefs.CloudPreferences.google_secure_devices_pin (   self)
Return if Google is allowed to unlock locks.

Definition at line 322 of file prefs.py.

◆ google_settings_version()

int homeassistant.components.cloud.prefs.CloudPreferences.google_settings_version (   self)
Return version of Google settings.

Definition at line 332 of file prefs.py.

◆ instance_id()

str | None homeassistant.components.cloud.prefs.CloudPreferences.instance_id (   self)
Return the instance ID.

Definition at line 357 of file prefs.py.

◆ remote_allow_remote_enable()

bool homeassistant.components.cloud.prefs.CloudPreferences.remote_allow_remote_enable (   self)
Return if it's allowed to remotely activate remote.

Definition at line 256 of file prefs.py.

◆ remote_domain()

str | None homeassistant.components.cloud.prefs.CloudPreferences.remote_domain (   self)
Return remote domain.

Definition at line 270 of file prefs.py.

◆ remote_enabled()

bool homeassistant.components.cloud.prefs.CloudPreferences.remote_enabled (   self)
Return if remote is enabled on start.

Definition at line 262 of file prefs.py.

◆ tts_default_voice()

tuple[str, str] homeassistant.components.cloud.prefs.CloudPreferences.tts_default_voice (   self)
Return the default TTS voice.

The return value is a tuple of language and voice.

Definition at line 362 of file prefs.py.

Member Data Documentation

◆ _hass

homeassistant.components.cloud.prefs.CloudPreferences._hass
private

Definition at line 117 of file prefs.py.

◆ _prefs

homeassistant.components.cloud.prefs.CloudPreferences._prefs
private

Definition at line 131 of file prefs.py.

◆ _store

homeassistant.components.cloud.prefs.CloudPreferences._store
private

Definition at line 118 of file prefs.py.

◆ last_updated

homeassistant.components.cloud.prefs.CloudPreferences.last_updated

Definition at line 402 of file prefs.py.


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