From a6a56c267ad64f6820e194e8f8a626a8f13d27dd Mon Sep 17 00:00:00 2001 From: farmio Date: Sun, 22 Mar 2026 14:57:33 +0100 Subject: [PATCH] Let EntityRegistry handle id creation --- homeassistant/components/knx/entity.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/knx/entity.py b/homeassistant/components/knx/entity.py index 35731277eb7..cd0285cc066 100644 --- a/homeassistant/components/knx/entity.py +++ b/homeassistant/components/knx/entity.py @@ -8,7 +8,7 @@ from xknx.devices import Device as XknxDevice from homeassistant.const import CONF_ENTITY_CATEGORY, CONF_NAME, EntityCategory from homeassistant.helpers.device_registry import DeviceInfo -from homeassistant.helpers.entity import Entity, async_generate_entity_id +from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity_platform import EntityPlatform from homeassistant.helpers.entity_registry import RegistryEntry @@ -110,12 +110,8 @@ class KnxYamlEntity(_KnxEntityBase): self._attr_entity_category = entity_config.get(CONF_ENTITY_CATEGORY) default_entity_id: str | None - if (default_entity_id := entity_config.get(CONF_DEFAULT_ENTITY_ID)) is None: - return - entity_platform, _, object_id = default_entity_id.partition(".") - self.entity_id = async_generate_entity_id( - f"{entity_platform}.{{}}", object_id, hass=knx_module.hass - ) + if (default_entity_id := entity_config.get(CONF_DEFAULT_ENTITY_ID)) is not None: + self.entity_id = default_entity_id class KnxUiEntity(_KnxEntityBase):