Classes | |
| class | _EventDeviceRegistryUpdatedData_CreateRemove |
| class | _EventDeviceRegistryUpdatedData_Update |
| class | ActiveDeviceRegistryItems |
| class | DeletedDeviceEntry |
| class | DeviceCollisionError |
| class | DeviceConnectionCollisionError |
| class | DeviceEntry |
| class | DeviceEntryDisabler |
| class | DeviceEntryType |
| class | DeviceIdentifierCollisionError |
| class | DeviceInfo |
| class | DeviceInfoError |
| class | DeviceRegistry |
| class | DeviceRegistryItems |
| class | DeviceRegistryStore |
Functions | |
| None | __init__ (self) |
| None | _index_entry (self, str key, _EntryTypeT entry) |
| set[tuple[str, str]] | _normalize_connections (set[tuple[str, str]] connections) |
| None | _unindex_entry (self, str key, _EntryTypeT|None replacement_entry=None) |
| str|None | _validate_configuration_url (Any value) |
| str | _validate_device_info (ConfigEntry config_entry, DeviceInfo device_info) |
| None | async_cleanup (HomeAssistant hass, DeviceRegistry dev_reg, entity_registry.EntityRegistry ent_reg) |
| None | async_config_entry_disabled_by_changed (DeviceRegistry registry, ConfigEntry config_entry) |
| list[DeviceEntry] | async_entries_for_area (DeviceRegistry registry, str area_id) |
| list[DeviceEntry] | async_entries_for_config_entry (DeviceRegistry registry, str config_entry_id) |
| list[DeviceEntry] | async_entries_for_label (DeviceRegistry registry, str label_id) |
| DeviceRegistry | async_get (HomeAssistant hass) |
| None | async_load (HomeAssistant hass) |
| None | async_setup_cleanup (HomeAssistant hass, DeviceRegistry dev_reg) |
| str | format_mac (str mac) |
| _EntryTypeT|None | get_entry (self, set[tuple[str, str]]|None identifiers, set[tuple[str, str]]|None connections) |
Variables | |
| __all__ = all_with_deprecated_constants(globals()) | |
| __dir__ | |
| __getattr__ = partial(check_if_deprecated_constant, module_globals=globals()) | |
| _cached_parse_url = lru_cache(maxsize=512)(URL) | |
| _DEPRECATED_DISABLED_CONFIG_ENTRY | |
| _DEPRECATED_DISABLED_INTEGRATION | |
| _DEPRECATED_DISABLED_USER = DeprecatedConstantEnum(DeviceEntryDisabler.USER, "2025.1") | |
| _LOGGER = logging.getLogger(__name__) | |
| int | CLEANUP_DELAY = 10 |
| dictionary | CONFIGURATION_URL_SCHEMES = {"http", "https", "homeassistant"} |
| string | CONNECTION_BLUETOOTH = "bluetooth" |
| string | CONNECTION_NETWORK_MAC = "mac" |
| string | CONNECTION_UPNP = "upnp" |
| string | CONNECTION_ZIGBEE = "zigbee" |
| DEVICE_INFO_KEYS = set.union(*(itm for itm in DEVICE_INFO_TYPES.values())) | |
| dictionary | DEVICE_INFO_TYPES |
| EventDeviceRegistryUpdatedData | |
| dictionary | LOW_PRIO_CONFIG_ENTRY_DOMAINS = {"homekit_controller", "matter", "mqtt", "upnp"} |
| int | ORPHANED_DEVICE_KEEP_SECONDS = 86400 * 30 |
| dictionary | RUNTIME_ONLY_ATTRS = {"suggested_area"} |
| string | STORAGE_KEY = "core.device_registry" |
| int | STORAGE_VERSION_MAJOR = 1 |
| int | STORAGE_VERSION_MINOR = 8 |
Provide a way to connect entities belonging to one device.
| None homeassistant.helpers.device_registry.__init__ | ( | self | ) |
Container for device registry items, maps device id -> entry. Maintains two additional indexes: - (connection_type, connection identifier) -> entry - (DOMAIN, identifier) -> entry
Initialize the container.
Definition at line 539 of file device_registry.py.
|
private |
Index an entry.
Definition at line 545 of file device_registry.py.
|
private |
Normalize connections to ensure we can match mac addresses.
Definition at line 1468 of file device_registry.py.
|
private |
Unindex an entry.
Definition at line 552 of file device_registry.py.
|
private |
Validate and convert configuration_url.
Definition at line 270 of file device_registry.py.
|
private |
Process a device info.
Definition at line 230 of file device_registry.py.
| None homeassistant.helpers.device_registry.async_cleanup | ( | HomeAssistant | hass, |
| DeviceRegistry | dev_reg, | ||
| entity_registry.EntityRegistry | ent_reg | ||
| ) |
Clean up device registry.
Definition at line 1346 of file device_registry.py.
| None homeassistant.helpers.device_registry.async_config_entry_disabled_by_changed | ( | DeviceRegistry | registry, |
| ConfigEntry | config_entry | ||
| ) |
Handle a config entry being disabled or enabled. Disable devices in the registry that are associated with a config entry when the config entry is disabled, enable devices in the registry that are associated with a config entry when the config entry is enabled and the devices are marked DeviceEntryDisabler.CONFIG_ENTRY. Only disable a device if all associated config entries are disabled.
Definition at line 1305 of file device_registry.py.
| list[DeviceEntry] homeassistant.helpers.device_registry.async_entries_for_area | ( | DeviceRegistry | registry, |
| str | area_id | ||
| ) |
Return entries that match an area.
Definition at line 1283 of file device_registry.py.
| list[DeviceEntry] homeassistant.helpers.device_registry.async_entries_for_config_entry | ( | DeviceRegistry | registry, |
| str | config_entry_id | ||
| ) |
Return entries that match a config entry.
Definition at line 1297 of file device_registry.py.
| list[DeviceEntry] homeassistant.helpers.device_registry.async_entries_for_label | ( | DeviceRegistry | registry, |
| str | label_id | ||
| ) |
Return entries that match a label.
Definition at line 1289 of file device_registry.py.
| DeviceRegistry homeassistant.helpers.device_registry.async_get | ( | HomeAssistant | hass | ) |
Get device registry.
Definition at line 1271 of file device_registry.py.
| None homeassistant.helpers.device_registry.async_load | ( | HomeAssistant | hass | ) |
Load device registry.
Definition at line 1276 of file device_registry.py.
| None homeassistant.helpers.device_registry.async_setup_cleanup | ( | HomeAssistant | hass, |
| DeviceRegistry | dev_reg | ||
| ) |
Clean up device registry when entities removed.
Definition at line 1388 of file device_registry.py.
| str homeassistant.helpers.device_registry.format_mac | ( | str | mac | ) |
Format the mac address string for entry into dev reg.
Definition at line 446 of file device_registry.py.
| _EntryTypeT | None homeassistant.helpers.device_registry.get_entry | ( | self, | |
| set[tuple[str, str]] | None | identifiers, | ||
| set[tuple[str, str]] | None | connections | ||
| ) |
Get entry from identifiers or connections.
Definition at line 562 of file device_registry.py.
|
private |
Definition at line 1481 of file device_registry.py.
|
private |
Definition at line 1478 of file device_registry.py.
|
private |
Definition at line 1477 of file device_registry.py.
|
private |
Definition at line 266 of file device_registry.py.
|
private |
Definition at line 89 of file device_registry.py.
|
private |
Definition at line 92 of file device_registry.py.
|
private |
Definition at line 95 of file device_registry.py.
|
private |
Definition at line 56 of file device_registry.py.
| int homeassistant.helpers.device_registry.CLEANUP_DELAY = 10 |
Definition at line 66 of file device_registry.py.
| dictionary homeassistant.helpers.device_registry.CONFIGURATION_URL_SCHEMES = {"http", "https", "homeassistant"} |
Definition at line 77 of file device_registry.py.
| string homeassistant.helpers.device_registry.CONNECTION_BLUETOOTH = "bluetooth" |
Definition at line 68 of file device_registry.py.
| string homeassistant.helpers.device_registry.CONNECTION_NETWORK_MAC = "mac" |
Definition at line 69 of file device_registry.py.
| string homeassistant.helpers.device_registry.CONNECTION_UPNP = "upnp" |
Definition at line 70 of file device_registry.py.
| string homeassistant.helpers.device_registry.CONNECTION_ZIGBEE = "zigbee" |
Definition at line 71 of file device_registry.py.
| homeassistant.helpers.device_registry.DEVICE_INFO_KEYS = set.union(*(itm for itm in DEVICE_INFO_TYPES.values())) |
Definition at line 156 of file device_registry.py.
| dictionary homeassistant.helpers.device_registry.DEVICE_INFO_TYPES |
Definition at line 123 of file device_registry.py.
| homeassistant.helpers.device_registry.EventDeviceRegistryUpdatedData |
Definition at line 177 of file device_registry.py.
| dictionary homeassistant.helpers.device_registry.LOW_PRIO_CONFIG_ENTRY_DOMAINS = {"homekit_controller", "matter", "mqtt", "upnp"} |
Definition at line 159 of file device_registry.py.
| int homeassistant.helpers.device_registry.ORPHANED_DEVICE_KEEP_SECONDS = 86400 * 30 |
Definition at line 73 of file device_registry.py.
| dictionary homeassistant.helpers.device_registry.RUNTIME_ONLY_ATTRS = {"suggested_area"} |
Definition at line 75 of file device_registry.py.
| string homeassistant.helpers.device_registry.STORAGE_KEY = "core.device_registry" |
Definition at line 62 of file device_registry.py.
| int homeassistant.helpers.device_registry.STORAGE_VERSION_MAJOR = 1 |
Definition at line 63 of file device_registry.py.
| int homeassistant.helpers.device_registry.STORAGE_VERSION_MINOR = 8 |
Definition at line 64 of file device_registry.py.