From 919e41595be03eb427e07d21660e98f4e8dc6631 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Tue, 8 Jul 2025 12:24:22 +0000 Subject: [PATCH] Fix update entity --- homeassistant/components/scrape/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/scrape/__init__.py b/homeassistant/components/scrape/__init__.py index ca79aced75b..5cff7ab9a7b 100644 --- a/homeassistant/components/scrape/__init__.py +++ b/homeassistant/components/scrape/__init__.py @@ -190,11 +190,13 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ScrapeConfigEntry) -> old_to_new_sensor_id[old_unique_id] = new_sub_entry.subentry_id hass.config_entries.async_add_subentry(entry, new_sub_entry) + _LOGGER.debug("Old to new %s", old_to_new_sensor_id) + # Use the new sub config entry id as the unique id for the sensor entity entity_reg = er.async_get(hass) entities = er.async_entries_for_config_entry(entity_reg, entry.entry_id) for entity in entities: - if entity.unique_id in old_to_new_sensor_id: + if (old_unique_id := entity.unique_id) in old_to_new_sensor_id: new_unique_id = old_to_new_sensor_id[old_unique_id] _LOGGER.debug( "Migrating entity %s with unique id %s to new unique id %s",