The methods for loading Home Assistant integrations.

This module has quite some complex parts. I have tried to add as much documentation as possible to keep it understandable.

exception homeassistant.loader.CircularDependency(from_domain: str, to_domain: str)[source]

Raised when a circular dependency is found when resolving components.

class homeassistant.loader.Components(hass: HomeAssistant)[source]

Helper to load components.

class homeassistant.loader.Helpers(hass: HomeAssistant)[source]

Helper to load helpers.

class homeassistant.loader.Integration(hass: HomeAssistant, pkg_path: str, file_path: pathlib.Path, manifest: Dict[str, Any])[source]

An integration in Home Assistant.

property after_dependencies

Return after_dependencies.

property all_dependencies

Return all dependencies including sub-dependencies.

property all_dependencies_resolved

Return if all dependencies have been resolved.

property config_flow

Return config_flow.

property dependencies

Return dependencies.

property disabled

Return reason integration is disabled.

property documentation

Return documentation.

property domain

Return domain.

get_component() → module[source]

Return the component.

get_platform(platform_name: str) → module[source]

Return a platform for an integration.

property homekit

Return Integration homekit entries.

property is_built_in

Test if package is a built-in integration.

property issue_tracker

Return issue tracker link.

property name

Return name.

property quality_scale

Return Integration Quality Scale.

property requirements

Return requirements.

async resolve_dependencies() → bool[source]

Resolve all dependencies.

classmethod resolve_from_root(hass: HomeAssistant, root_module: module, domain: str) → Optional[Integration][source]

Resolve an integration from a root module.

classmethod resolve_legacy(hass: HomeAssistant, domain: str) → Optional[Integration][source]

Resolve legacy component.

Will create a stub manifest.

property ssdp

Return Integration SSDP entries.

property zeroconf

Return Integration zeroconf entries.

exception homeassistant.loader.IntegrationNotFound(domain: str)[source]

Raised when a component is not found.

exception homeassistant.loader.LoaderError[source]

Loader base error.

class homeassistant.loader.ModuleWrapper(hass: HomeAssistant, module: module)[source]

Class to wrap a Python module and auto fill in hass argument.

async homeassistant.loader.async_get_config_flows(hass: HomeAssistant) → Set[str][source]

Return cached list of config flows.

async homeassistant.loader.async_get_custom_components(hass: HomeAssistant) → Dict[str, Integration][source]

Return cached list of custom integrations.

async homeassistant.loader.async_get_homekit(hass: HomeAssistant) → Dict[str, str][source]

Return cached list of homekit models.

async homeassistant.loader.async_get_integration(hass: HomeAssistant, domain: str) → homeassistant.loader.Integration[source]

Get an integration.

async homeassistant.loader.async_get_ssdp(hass: HomeAssistant) → Dict[str, List][source]

Return cached list of ssdp mappings.

async homeassistant.loader.async_get_zeroconf(hass: HomeAssistant) → Dict[str, List[Dict[str, str]]][source]

Return cached list of zeroconf types.

homeassistant.loader.bind_hass(func: CALLABLE_T) → CALLABLE_T[source]

Decorate function to indicate that first argument is hass.

homeassistant.loader.manifest_from_legacy_module(domain: str, module: module) → Dict[source]

Generate a manifest from a legacy module.