homeassistant.helpers
¶
Helper methods for components within Home Assistant.
-
homeassistant.helpers.
config_per_platform
(config: ConfigType, domain: str) → Iterable[tuple[str | None, ConfigType]][source]¶ Break a component config into different platforms.
For example, will find ‘switch’, ‘switch 2’, ‘switch 3’, .. etc Async friendly.
-
homeassistant.helpers.
extract_domain_configs
(config: ConfigType, domain: str) → Sequence[str][source]¶ Extract keys from config for given domain name.
Async friendly.
homeassistant.helpers.aiohttp_client¶
homeassistant.helpers.area_registry¶
homeassistant.helpers.check_config¶
homeassistant.helpers.collection¶
homeassistant.helpers.condition¶
homeassistant.helpers.config_entry_flow¶
homeassistant.helpers.config_entry_oauth2_flow¶
homeassistant.helpers.config_validation¶
homeassistant.helpers.data_entry_flow¶
homeassistant.helpers.debounce¶
homeassistant.helpers.deprecation¶
Deprecation helpers for Home Assistant.
-
homeassistant.helpers.deprecation.
deprecated_class
(replacement: str) → Any[source]¶ Mark class as deprecated and provide a replacement class to be used instead.
-
homeassistant.helpers.deprecation.
deprecated_function
(replacement: str) → Callable[..., Callable][source]¶ Mark function as deprecated and provide a replacement function to be used instead.
-
homeassistant.helpers.deprecation.
deprecated_substitute
(substitute_name: str) → Callable[..., Callable][source]¶ Help migrate properties to new names.
When a property is added to replace an older property, this decorator can be added to the new property, listing the old property as the substitute. If the old property is defined, its value will be used instead, and a log warning will be issued alerting the user of the impending change.
-
homeassistant.helpers.deprecation.
get_deprecated
(config: dict[str, Any], new_name: str, old_name: str, default: Any | None = None) → Any | None[source]¶ Allow an old config name to be deprecated with a replacement.
If the new config isn’t found, but the old one is, the old value is used and a warning is issued to the user.
homeassistant.helpers.device_registry¶
homeassistant.helpers.discovery¶
homeassistant.helpers.dispatcher¶
homeassistant.helpers.entity¶
homeassistant.helpers.entity_component¶
homeassistant.helpers.entity_platform¶
homeassistant.helpers.entity_registry¶
homeassistant.helpers.entity_values¶
homeassistant.helpers.entityfilter¶
homeassistant.helpers.event¶
homeassistant.helpers.icon¶
Icon helper methods.
homeassistant.helpers.integration_platform¶
homeassistant.helpers.intent¶
homeassistant.helpers.json¶
Helpers to help with encoding Home Assistant objects in JSON.
-
class
homeassistant.helpers.json.
ExtendedJSONEncoder
(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶ Bases:
homeassistant.helpers.json.JSONEncoder
JSONEncoder that supports Home Assistant objects and falls back to repr(o).