homeassistant.config_entries
¶
Manage config entries in Home Assistant.
-
class
homeassistant.config_entries.
ConfigEntries
(hass: homeassistant.core.HomeAssistant, hass_config: dict)[source]¶ Manage the configuration entries.
An instance of this object is available via hass.config_entries.
-
async
async_add
(entry: homeassistant.config_entries.ConfigEntry) → None[source]¶ Add and setup an entry.
-
async_domains
(include_ignore: bool = False, include_disabled: bool = False) → list[str][source]¶ Return domains for which we have entries.
-
async_entries
(domain: str | None = None) → list[ConfigEntry][source]¶ Return all entries or entries for a specific domain.
-
async
async_forward_entry_setup
(entry: homeassistant.config_entries.ConfigEntry, domain: str) → bool[source]¶ Forward the setup of an entry to a different component.
By default an entry is setup with the component it belongs to. If that component also has related platforms, the component will have to forward the entry to be setup by that component.
You don’t want to await this coroutine if it is called as part of the setup of a component, because it can cause a deadlock.
-
async
async_forward_entry_unload
(entry: homeassistant.config_entries.ConfigEntry, domain: str) → bool[source]¶ Forward the unloading of an entry to a different component.
-
async
async_reload
(entry_id: str) → bool[source]¶ Reload an entry.
If an entry was not loaded, will just load.
-
async
async_set_disabled_by
(entry_id: str, disabled_by: str | None) → bool[source]¶ Disable an entry.
If disabled_by is changed, the config entry will be reloaded.
-
async
async_setup
(entry_id: str) → bool[source]¶ Set up a config entry.
Return True if entry has been successfully loaded.
-
async_update_entry
(entry: ConfigEntry, *, unique_id: str | dict | None | UndefinedType = <UndefinedType._singleton: 0>, title: str | dict | UndefinedType = <UndefinedType._singleton: 0>, data: dict | UndefinedType = <UndefinedType._singleton: 0>, options: dict | UndefinedType = <UndefinedType._singleton: 0>, system_options: dict | UndefinedType = <UndefinedType._singleton: 0>) → bool[source]¶ Update a config entry.
If the entry was changed, the update_listeners are fired and this function returns True
If the entry was not changed, the update_listeners are not fired and this function returns False
-
async
-
class
homeassistant.config_entries.
ConfigEntriesFlowManager
(hass: homeassistant.core.HomeAssistant, config_entries: homeassistant.config_entries.ConfigEntries, hass_config: dict)[source]¶ Manage all the config entry flows that are in progress.
-
async
async_create_flow
(handler_key: Any, *, context: dict | None = None, data: Any = None) → ConfigFlow[source]¶ Create a flow for specified handler.
Handler key is the domain of the component that we want to set up.
-
async
-
class
homeassistant.config_entries.
ConfigEntry
(version: int, domain: str, title: str, data: dict, source: str, connection_class: str, system_options: dict, options: dict | None = None, unique_id: str | None = None, entry_id: str | None = None, state: str = 'not_loaded', disabled_by: str | None = None)[source]¶ Hold a configuration entry.
-
add_update_listener
(listener: Callable[[homeassistant.core.HomeAssistant, ConfigEntry], Any]) → Callable[[], None][source]¶ Listen for when entry is updated.
Returns function to unlisten.
-
async
async_migrate
(hass: homeassistant.core.HomeAssistant) → bool[source]¶ Migrate an entry.
Returns True if config entry is up-to-date or has been migrated.
-
async
async_remove
(hass: homeassistant.core.HomeAssistant) → None[source]¶ Invoke remove callback on component.
-
-
class
homeassistant.config_entries.
ConfigFlow
[source]¶ Base class for config flows with some helpers.
-
async_abort
(*, reason: str, description_placeholders: dict | None = None) → dict[str, Any][source]¶ Abort the config flow.
-
static
async_get_options_flow
(config_entry: homeassistant.config_entries.ConfigEntry) → homeassistant.config_entries.OptionsFlow[source]¶ Get the options flow for this handler.
-
async
async_set_unique_id
(unique_id: str | None = None, *, raise_on_progress: bool = True) → ConfigEntry | None[source]¶ Set a unique ID for the config flow.
Returns optionally existing config entry with same ID.
-
async
async_step_dhcp
(discovery_info: dict[str, Any]) → dict[str, Any][source]¶ Handle a flow initialized by discovery.
-
async
async_step_discovery
(discovery_info: dict[str, Any]) → dict[str, Any][source]¶ Handle a flow initialized by discovery.
-
async
async_step_hassio
(discovery_info: dict[str, Any]) → dict[str, Any][source]¶ Handle a flow initialized by discovery.
-
async
async_step_homekit
(discovery_info: dict[str, Any]) → dict[str, Any][source]¶ Handle a flow initialized by discovery.
-
async
async_step_ignore
(user_input: dict[str, Any]) → dict[str, Any][source]¶ Ignore this config flow.
-
async
async_step_mqtt
(discovery_info: dict[str, Any]) → dict[str, Any][source]¶ Handle a flow initialized by discovery.
-
async
async_step_ssdp
(discovery_info: dict[str, Any]) → dict[str, Any][source]¶ Handle a flow initialized by discovery.
-
async
async_step_unignore
(user_input: dict[str, Any]) → dict[str, Any][source]¶ Rediscover a config entry by it’s unique_id.
-
async
async_step_user
(user_input: dict[str, Any] | None = None) → dict[str, Any][source]¶ Handle a flow initiated by the user.
-
async
async_step_zeroconf
(discovery_info: dict[str, Any]) → dict[str, Any][source]¶ Handle a flow initialized by discovery.
-
property
unique_id
¶ Return unique ID if available.
-
-
class
homeassistant.config_entries.
EntityRegistryDisabledHandler
(hass: homeassistant.core.HomeAssistant)[source]¶ Handler to handle when entities related to config entries updating disabled_by.
-
exception
homeassistant.config_entries.
OperationNotAllowed
[source]¶ Raised when a config entry operation is not allowed.
-
class
homeassistant.config_entries.
OptionsFlowManager
(hass: homeassistant.core.HomeAssistant)[source]¶ Flow to set options for a configuration entry.