From de9c7461f4326bc4fa48c5d20281f6a057d80d11 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Mon, 5 Oct 2026 18:05:19 +0000 Subject: [PATCH] Update options last --- homeassistant/components/group/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/group/__init__.py b/homeassistant/components/group/__init__.py index 3b8354cbcc4f..d39681cfa29e 100644 --- a/homeassistant/components/group/__init__.py +++ b/homeassistant/components/group/__init__.py @@ -156,11 +156,6 @@ async def async_clean_import(hass: HomeAssistant, entry: ConfigEntry) -> None: entities = er.async_entries_for_config_entry(entity_reg, old_config_entry_id) old_entity_entry = entities[0] if entities else None - # Update options to not run migration again - new_options = dict(entry.options) - new_options.pop("old_config_entry_id") - hass.config_entries.async_update_entry(entry, options=new_options) - if not old_config_entry or not old_entity_entry: # User has manually removed the entry or entity before we came here # Skip the migration and just continue with setting up the group sensor @@ -188,6 +183,11 @@ async def async_clean_import(hass: HomeAssistant, entry: ConfigEntry) -> None: ) from err await hass.config_entries.async_remove(old_entity_entry.config_entry_id) + # Update options to not run migration again + new_options = dict(entry.options) + new_options.pop("old_config_entry_id") + hass.config_entries.async_update_entry(entry, options=new_options) + async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up a config entry."""