Home Assistant Unofficial Reference 2024.12.1
homeassistant.config_entries Namespace Reference

Classes

class  ConfigEntries
 
class  ConfigEntriesFlowManager
 
class  ConfigEntry
 
class  ConfigEntryBaseFlow
 
class  ConfigEntryChange
 
class  ConfigEntryDisabler
 
class  ConfigEntryItems
 
class  ConfigEntryState
 
class  ConfigEntryStore
 
class  ConfigError
 
class  ConfigFlow
 
class  ConfigFlowContext
 
class  ConfigFlowResult
 
class  EntityRegistryDisabledHandler
 
class  FlowCancelledError
 
class  OperationNotAllowed
 
class  OptionsFlow
 
class  OptionsFlowManager
 
class  OptionsFlowWithConfigEntry
 
class  UnknownEntry
 

Functions

None _async_abort_entries_match (list[ConfigEntry] other_entries, dict[str, Any]|None match_dict=None)
 
type[ConfigFlow_async_get_flow_handler (HomeAssistant hass, str domain, ConfigType hass_config)
 
bool _handle_entry_updated_filter (er.EventEntityRegistryUpdatedData event_data)
 
None _load_integration (HomeAssistant hass, str domain, ConfigType hass_config)
 
None _report_non_awaited_platform_forwards (ConfigEntry entry, str what)
 
bool _support_single_config_entry_only (HomeAssistant hass, str domain)
 
None _validate_item (*ConfigEntryDisabler|Any|None disabled_by=None)
 
SignalType[ConfigEntrysignal_discovered_config_entry_removed (str discovery_domain)
 
bool support_entry_unload (HomeAssistant hass, str domain)
 
bool support_remove_from_device (HomeAssistant hass, str domain)
 

Variables

 _DataT = TypeVar("_DataT", default=Any)
 
 _LOGGER = logging.getLogger(__name__)
 
string CONN_CLASS_ASSUMED = "assumed"
 
string CONN_CLASS_CLOUD_POLL = "cloud_poll"
 
string CONN_CLASS_CLOUD_PUSH = "cloud_push"
 
string CONN_CLASS_LOCAL_POLL = "local_poll"
 
string CONN_CLASS_LOCAL_PUSH = "local_push"
 
string CONN_CLASS_UNKNOWN = "unknown"
 
string DEFAULT_DISCOVERY_UNIQUE_ID = "default_discovery_unique_id"
 
 DISABLED_USER = ConfigEntryDisabler.USER.value
 
int DISCOVERY_COOLDOWN = 1
 
string DISCOVERY_NOTIFICATION_ID = "config_entry_discovery"
 
dictionary DISCOVERY_SOURCES
 
string EVENT_FLOW_DISCOVERED = "config_entry_discovered"
 
dictionary FROZEN_CONFIG_ENTRY_ATTRS = {"entry_id", "domain", *STATE_KEYS}
 
string ISSUE_UNIQUE_ID_COLLISION = "config_entry_unique_id_collision"
 
dictionary NO_RESET_TRIES_STATES
 
string RECONFIGURE_NOTIFICATION_ID = "config_entry_reconfigure"
 
int RELOAD_AFTER_UPDATE_DELAY = 30
 
int SAVE_DELAY = 1
 
 SIGNAL_CONFIG_ENTRY_CHANGED
 
string SOURCE_BLUETOOTH = "bluetooth"
 
string SOURCE_DHCP = "dhcp"
 
string SOURCE_DISCOVERY = "discovery"
 
string SOURCE_HARDWARE = "hardware"
 
string SOURCE_HASSIO = "hassio"
 
string SOURCE_HOMEKIT = "homekit"
 
string SOURCE_IGNORE = "ignore"
 
string SOURCE_IMPORT = "import"
 
string SOURCE_INTEGRATION_DISCOVERY = "integration_discovery"
 
string SOURCE_MQTT = "mqtt"
 
string SOURCE_REAUTH = "reauth"
 
string SOURCE_RECONFIGURE = "reconfigure"
 
string SOURCE_SSDP = "ssdp"
 
string SOURCE_SYSTEM = "system"
 
string SOURCE_USB = "usb"
 
string SOURCE_USER = "user"
 
string SOURCE_ZEROCONF = "zeroconf"
 
dictionary STATE_KEYS
 
string STORAGE_KEY = "core.config_entries"
 
int STORAGE_VERSION = 1
 
int STORAGE_VERSION_MINOR = 4
 
int UNIQUE_ID_COLLISION_TITLE_LIMIT = 5
 
dictionary UPDATE_ENTRY_CONFIG_ENTRY_ATTRS
 
 UpdateListenerType
 

Detailed Description

Manage config entries in Home Assistant.

Function Documentation

◆ _async_abort_entries_match()

None homeassistant.config_entries._async_abort_entries_match ( list[ConfigEntry other_entries,
dict[str, Any] | None   match_dict = None 
)
private
Abort if current entries match all data.

Requires `already_configured` in strings.json in user visible flows.

Definition at line 2532 of file config_entries.py.

◆ _async_get_flow_handler()

type[ConfigFlow] homeassistant.config_entries._async_get_flow_handler ( HomeAssistant  hass,
str  domain,
ConfigType   hass_config 
)
private
Get a flow handler for specified domain.

Definition at line 3322 of file config_entries.py.

◆ _handle_entry_updated_filter()

bool homeassistant.config_entries._handle_entry_updated_filter ( er.EventEntityRegistryUpdatedData  event_data)
private
Handle entity registry entry update filter.

Only handle changes to "disabled_by".
If "disabled_by" was CONFIG_ENTRY, reload is not needed.

Definition at line 3265 of file config_entries.py.

◆ _load_integration()

None homeassistant.config_entries._load_integration ( HomeAssistant  hass,
str  domain,
ConfigType   hass_config 
)
private

Definition at line 3300 of file config_entries.py.

◆ _report_non_awaited_platform_forwards()

None homeassistant.config_entries._report_non_awaited_platform_forwards ( ConfigEntry  entry,
str  what 
)
private
Report non awaited platform forwards.

Definition at line 1197 of file config_entries.py.

◆ _support_single_config_entry_only()

bool homeassistant.config_entries._support_single_config_entry_only ( HomeAssistant  hass,
str  domain 
)
private
Test if a domain supports only a single config entry.

Definition at line 3294 of file config_entries.py.

◆ _validate_item()

None homeassistant.config_entries._validate_item ( *ConfigEntryDisabler | Any | None   disabled_by = None)
private
Validate config entry item.

Definition at line 306 of file config_entries.py.

◆ signal_discovered_config_entry_removed()

SignalType[ConfigEntry] homeassistant.config_entries.signal_discovered_config_entry_removed ( str  discovery_domain)
Format signal.

Definition at line 208 of file config_entries.py.

◆ support_entry_unload()

bool homeassistant.config_entries.support_entry_unload ( HomeAssistant  hass,
str  domain 
)
Test if a domain supports entry unloading.

Definition at line 3280 of file config_entries.py.

◆ support_remove_from_device()

bool homeassistant.config_entries.support_remove_from_device ( HomeAssistant  hass,
str  domain 
)
Test if a domain supports being removed from a device.

Definition at line 3287 of file config_entries.py.

Variable Documentation

◆ _DataT

homeassistant.config_entries._DataT = TypeVar("_DataT", default=Any)
private

Definition at line 140 of file config_entries.py.

◆ _LOGGER

homeassistant.config_entries._LOGGER = logging.getLogger(__name__)
private

Definition at line 99 of file config_entries.py.

◆ CONN_CLASS_ASSUMED

string homeassistant.config_entries.CONN_CLASS_ASSUMED = "assumed"

Definition at line 247 of file config_entries.py.

◆ CONN_CLASS_CLOUD_POLL

string homeassistant.config_entries.CONN_CLASS_CLOUD_POLL = "cloud_poll"

Definition at line 244 of file config_entries.py.

◆ CONN_CLASS_CLOUD_PUSH

string homeassistant.config_entries.CONN_CLASS_CLOUD_PUSH = "cloud_push"

Definition at line 243 of file config_entries.py.

◆ CONN_CLASS_LOCAL_POLL

string homeassistant.config_entries.CONN_CLASS_LOCAL_POLL = "local_poll"

Definition at line 246 of file config_entries.py.

◆ CONN_CLASS_LOCAL_PUSH

string homeassistant.config_entries.CONN_CLASS_LOCAL_PUSH = "local_push"

Definition at line 245 of file config_entries.py.

◆ CONN_CLASS_UNKNOWN

string homeassistant.config_entries.CONN_CLASS_UNKNOWN = "unknown"

Definition at line 248 of file config_entries.py.

◆ DEFAULT_DISCOVERY_UNIQUE_ID

string homeassistant.config_entries.DEFAULT_DISCOVERY_UNIQUE_ID = "default_discovery_unique_id"

Definition at line 180 of file config_entries.py.

◆ DISABLED_USER

homeassistant.config_entries.DISABLED_USER = ConfigEntryDisabler.USER.value

Definition at line 236 of file config_entries.py.

◆ DISCOVERY_COOLDOWN

int homeassistant.config_entries.DISCOVERY_COOLDOWN = 1

Definition at line 135 of file config_entries.py.

◆ DISCOVERY_NOTIFICATION_ID

string homeassistant.config_entries.DISCOVERY_NOTIFICATION_ID = "config_entry_discovery"

Definition at line 181 of file config_entries.py.

◆ DISCOVERY_SOURCES

dictionary homeassistant.config_entries.DISCOVERY_SOURCES
Initial value:
1 = {
2  SOURCE_BLUETOOTH,
3  SOURCE_DHCP,
4  SOURCE_DISCOVERY,
5  SOURCE_HARDWARE,
6  SOURCE_HASSIO,
7  SOURCE_HOMEKIT,
8  SOURCE_IMPORT,
9  SOURCE_INTEGRATION_DISCOVERY,
10  SOURCE_MQTT,
11  SOURCE_SSDP,
12  SOURCE_SYSTEM,
13  SOURCE_USB,
14  SOURCE_ZEROCONF,
15 }

Definition at line 182 of file config_entries.py.

◆ EVENT_FLOW_DISCOVERED

string homeassistant.config_entries.EVENT_FLOW_DISCOVERED = "config_entry_discovered"

Definition at line 200 of file config_entries.py.

◆ FROZEN_CONFIG_ENTRY_ATTRS

dictionary homeassistant.config_entries.FROZEN_CONFIG_ENTRY_ATTRS = {"entry_id", "domain", *STATE_KEYS}

Definition at line 273 of file config_entries.py.

◆ ISSUE_UNIQUE_ID_COLLISION

string homeassistant.config_entries.ISSUE_UNIQUE_ID_COLLISION = "config_entry_unique_id_collision"

Definition at line 137 of file config_entries.py.

◆ NO_RESET_TRIES_STATES

dictionary homeassistant.config_entries.NO_RESET_TRIES_STATES
Initial value:
1 = {
2  ConfigEntryState.SETUP_RETRY,
3  ConfigEntryState.SETUP_IN_PROGRESS,
4 }

Definition at line 215 of file config_entries.py.

◆ RECONFIGURE_NOTIFICATION_ID

string homeassistant.config_entries.RECONFIGURE_NOTIFICATION_ID = "config_entry_reconfigure"

Definition at line 198 of file config_entries.py.

◆ RELOAD_AFTER_UPDATE_DELAY

int homeassistant.config_entries.RELOAD_AFTER_UPDATE_DELAY = 30

Definition at line 238 of file config_entries.py.

◆ SAVE_DELAY

int homeassistant.config_entries.SAVE_DELAY = 1

Definition at line 133 of file config_entries.py.

◆ SIGNAL_CONFIG_ENTRY_CHANGED

homeassistant.config_entries.SIGNAL_CONFIG_ENTRY_CHANGED
Initial value:
1 = SignalType["ConfigEntryChange", "ConfigEntry"](
2  "config_entry_changed"
3 )

Definition at line 202 of file config_entries.py.

◆ SOURCE_BLUETOOTH

string homeassistant.config_entries.SOURCE_BLUETOOTH = "bluetooth"

Definition at line 101 of file config_entries.py.

◆ SOURCE_DHCP

string homeassistant.config_entries.SOURCE_DHCP = "dhcp"

Definition at line 102 of file config_entries.py.

◆ SOURCE_DISCOVERY

string homeassistant.config_entries.SOURCE_DISCOVERY = "discovery"

Definition at line 103 of file config_entries.py.

◆ SOURCE_HARDWARE

string homeassistant.config_entries.SOURCE_HARDWARE = "hardware"

Definition at line 104 of file config_entries.py.

◆ SOURCE_HASSIO

string homeassistant.config_entries.SOURCE_HASSIO = "hassio"

Definition at line 105 of file config_entries.py.

◆ SOURCE_HOMEKIT

string homeassistant.config_entries.SOURCE_HOMEKIT = "homekit"

Definition at line 106 of file config_entries.py.

◆ SOURCE_IGNORE

string homeassistant.config_entries.SOURCE_IGNORE = "ignore"

Definition at line 119 of file config_entries.py.

◆ SOURCE_IMPORT

string homeassistant.config_entries.SOURCE_IMPORT = "import"

Definition at line 107 of file config_entries.py.

◆ SOURCE_INTEGRATION_DISCOVERY

string homeassistant.config_entries.SOURCE_INTEGRATION_DISCOVERY = "integration_discovery"

Definition at line 108 of file config_entries.py.

◆ SOURCE_MQTT

string homeassistant.config_entries.SOURCE_MQTT = "mqtt"

Definition at line 109 of file config_entries.py.

◆ SOURCE_REAUTH

string homeassistant.config_entries.SOURCE_REAUTH = "reauth"

Definition at line 122 of file config_entries.py.

◆ SOURCE_RECONFIGURE

string homeassistant.config_entries.SOURCE_RECONFIGURE = "reconfigure"

Definition at line 125 of file config_entries.py.

◆ SOURCE_SSDP

string homeassistant.config_entries.SOURCE_SSDP = "ssdp"

Definition at line 110 of file config_entries.py.

◆ SOURCE_SYSTEM

string homeassistant.config_entries.SOURCE_SYSTEM = "system"

Definition at line 111 of file config_entries.py.

◆ SOURCE_USB

string homeassistant.config_entries.SOURCE_USB = "usb"

Definition at line 112 of file config_entries.py.

◆ SOURCE_USER

string homeassistant.config_entries.SOURCE_USER = "user"

Definition at line 113 of file config_entries.py.

◆ SOURCE_ZEROCONF

string homeassistant.config_entries.SOURCE_ZEROCONF = "zeroconf"

Definition at line 114 of file config_entries.py.

◆ STATE_KEYS

dictionary homeassistant.config_entries.STATE_KEYS
Initial value:
1 = {
2  "state",
3  "reason",
4  "error_reason_translation_key",
5  "error_reason_translation_placeholders",
6 }

Definition at line 267 of file config_entries.py.

◆ STORAGE_KEY

string homeassistant.config_entries.STORAGE_KEY = "core.config_entries"

Definition at line 129 of file config_entries.py.

◆ STORAGE_VERSION

int homeassistant.config_entries.STORAGE_VERSION = 1

Definition at line 130 of file config_entries.py.

◆ STORAGE_VERSION_MINOR

int homeassistant.config_entries.STORAGE_VERSION_MINOR = 4

Definition at line 131 of file config_entries.py.

◆ UNIQUE_ID_COLLISION_TITLE_LIMIT

int homeassistant.config_entries.UNIQUE_ID_COLLISION_TITLE_LIMIT = 5

Definition at line 138 of file config_entries.py.

◆ UPDATE_ENTRY_CONFIG_ENTRY_ATTRS

dictionary homeassistant.config_entries.UPDATE_ENTRY_CONFIG_ENTRY_ATTRS
Initial value:
1 = {
2  "unique_id",
3  "title",
4  "data",
5  "options",
6  "pref_disable_new_entities",
7  "pref_disable_polling",
8  "minor_version",
9  "version",
10 }

Definition at line 274 of file config_entries.py.

◆ UpdateListenerType

homeassistant.config_entries.UpdateListenerType

Definition at line 263 of file config_entries.py.