From 5c09591f54a7ab647a174f8a40dd5545c67ee825 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 24 Jun 2025 18:47:09 +0200 Subject: [PATCH] actually is possible --- homeassistant/components/esphome/entity.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/esphome/entity.py b/homeassistant/components/esphome/entity.py index 13b0c9d99c0..99e9d6704d7 100644 --- a/homeassistant/components/esphome/entity.py +++ b/homeassistant/components/esphome/entity.py @@ -105,17 +105,8 @@ def async_static_info_updated( entity_id = entry.entity_id break - # If entity not found in registry, add it as new - if entity_id is None: - _LOGGER.info( - "Entity with unique_id %s not found in registry when device_id changed from %s to %s, adding as new entity", - old_unique_id, - old_info.device_id, - info.device_id, - ) - entity = entity_type(entry_data, platform.domain, info, state_type) - add_entities.append(entity) - continue + # Entity must exist in registry since we found it in current_infos + assert entity_id is not None updates: dict[str, Any] = {}