Classes | |
| class | DiscoveryDict |
Functions | |
| None | async_discover (core.HomeAssistant hass, str service, DiscoveryInfoType|None discovered, str|None component, ConfigType hass_config) |
| None | async_listen (core.HomeAssistant hass, str service, Callable[[str, DiscoveryInfoType|None], Coroutine[Any, Any, None]|None] callback) |
| Callable[[], None] | async_listen_platform (core.HomeAssistant hass, str component, Callable[[str, dict[str, Any]|None], Any] callback) |
| None | async_load_platform (core.HomeAssistant hass, Platform|str component, str platform, DiscoveryInfoType|None discovered, ConfigType hass_config) |
| None | discover (core.HomeAssistant hass, str service, DiscoveryInfoType discovered, str component, ConfigType hass_config) |
| None | load_platform (core.HomeAssistant hass, Platform|str component, str platform, DiscoveryInfoType|None discovered, ConfigType hass_config) |
Variables | |
| string | ATTR_DISCOVERED = "discovered" |
| string | ATTR_PLATFORM = "platform" |
| string | EVENT_LOAD_PLATFORM = "load_platform.{}" |
Helper methods to help with platform discovery. There are two different types of discoveries that can be fired/listened for. - listen/discover is for services. These are targeted at a component. - listen_platform/discover_platform is for platforms. These are used by components to allow discovery of their platforms.
| None homeassistant.helpers.discovery.async_discover | ( | core.HomeAssistant | hass, |
| str | service, | ||
| DiscoveryInfoType | None | discovered, | ||
| str | None | component, | ||
| ConfigType | hass_config | ||
| ) |
Fire discovery event. Can ensure a component is loaded.
Definition at line 81 of file discovery.py.
| None homeassistant.helpers.discovery.async_listen | ( | core.HomeAssistant | hass, |
| str | service, | ||
| Callable[ [str, DiscoveryInfoType | None], Coroutine[Any, Any, None] | None ] | callback | ||
| ) |
Set up listener for discovery of specific service. Service can be a string or a list/tuple.
Definition at line 40 of file discovery.py.
| Callable[[], None] homeassistant.helpers.discovery.async_listen_platform | ( | core.HomeAssistant | hass, |
| str | component, | ||
| Callable[[str, dict[str, Any] | None], Any] | callback | ||
| ) |
Register a platform loader listener. This method must be run in the event loop.
Definition at line 104 of file discovery.py.
| None homeassistant.helpers.discovery.async_load_platform | ( | core.HomeAssistant | hass, |
| Platform | str | component, | ||
| str | platform, | ||
| DiscoveryInfoType | None | discovered, | ||
| ConfigType | hass_config | ||
| ) |
Load a component and platform dynamically. Use `async_listen_platform` to register a callback for these events. Warning: This method can load a base component if its not loaded which can take a long time since base components currently have to import every platform integration listed under it to do config validation. To avoid waiting for this, use `hass.async_create_task(async_load_platform(..))` instead.
Definition at line 146 of file discovery.py.
| None homeassistant.helpers.discovery.discover | ( | core.HomeAssistant | hass, |
| str | service, | ||
| DiscoveryInfoType | discovered, | ||
| str | component, | ||
| ConfigType | hass_config | ||
| ) |
Fire discovery event. Can ensure a component is loaded.
Definition at line 66 of file discovery.py.
| None homeassistant.helpers.discovery.load_platform | ( | core.HomeAssistant | hass, |
| Platform | str | component, | ||
| str | platform, | ||
| DiscoveryInfoType | None | discovered, | ||
| ConfigType | hass_config | ||
| ) |
Load a component and platform dynamically.
Definition at line 131 of file discovery.py.
| string homeassistant.helpers.discovery.ATTR_DISCOVERED = "discovered" |
Definition at line 27 of file discovery.py.
| string homeassistant.helpers.discovery.ATTR_PLATFORM = "platform" |
Definition at line 26 of file discovery.py.
| string homeassistant.helpers.discovery.EVENT_LOAD_PLATFORM = "load_platform.{}" |
Definition at line 25 of file discovery.py.