From d72b35a0cda78291e4d8ea459683aaa150bc8c09 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 29 Aug 2025 17:27:39 +0200 Subject: [PATCH] Improve comment on disabled_by + hidden_by flag in registries (#151290) Co-authored-by: Martin Hjelmare Co-authored-by: Franck Nijhof --- homeassistant/helpers/device_registry.py | 2 +- homeassistant/helpers/entity_registry.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/helpers/device_registry.py b/homeassistant/helpers/device_registry.py index aa619c1dc41..9e57c7ee788 100644 --- a/homeassistant/helpers/device_registry.py +++ b/homeassistant/helpers/device_registry.py @@ -836,7 +836,7 @@ class DeviceRegistry(BaseRegistry[dict[str, list[dict[str, Any]]]]): default_manufacturer: str | None | UndefinedType = UNDEFINED, default_model: str | None | UndefinedType = UNDEFINED, default_name: str | None | UndefinedType = UNDEFINED, - # To disable a device if it gets created + # To disable a device if it gets created, does not affect existing devices disabled_by: DeviceEntryDisabler | None | UndefinedType = UNDEFINED, entry_type: DeviceEntryType | None | UndefinedType = UNDEFINED, hw_version: str | None | UndefinedType = UNDEFINED, diff --git a/homeassistant/helpers/entity_registry.py b/homeassistant/helpers/entity_registry.py index 95aa153ff00..f10edf1f57d 100644 --- a/homeassistant/helpers/entity_registry.py +++ b/homeassistant/helpers/entity_registry.py @@ -908,7 +908,8 @@ class EntityRegistry(BaseRegistry): # To influence entity ID generation calculated_object_id: str | None = None, suggested_object_id: str | None = None, - # To disable or hide an entity if it gets created + # To disable or hide an entity if it gets created, does not affect + # existing entities disabled_by: RegistryEntryDisabler | None = None, hidden_by: RegistryEntryHider | None = None, # Function to generate initial entity options if it gets created