From d46f81db0c4dbbddaabb66591b09739de2ca7c27 Mon Sep 17 00:00:00 2001 From: figorr <77553975+figorr@users.noreply.github.com> Date: Thu, 24 Apr 2025 01:39:55 +0200 Subject: [PATCH] Fix error migrating PoolLab for poollab Fix migration error after updating to version 1.1.4 --- custom_components/poollab/__init__.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/custom_components/poollab/__init__.py b/custom_components/poollab/__init__.py index 8ee2f14..e3d86ca 100644 --- a/custom_components/poollab/__init__.py +++ b/custom_components/poollab/__init__.py @@ -104,13 +104,18 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> version = config_entry.version _LOGGER.debug("Migrating from version %s", version) - new_data = {**config_entry.data} - if version == 1: - config_entry.version = 2 + new_data = {**config_entry.data} new_data[CONF_URL] = API_ENDPOINT - hass.config_entries.async_update_entry(config_entry, data=new_data) - _LOGGER.info("Migration to version %s successful", config_entry.version) + + hass.config_entries.async_update_entry( + config_entry, + data=new_data, + version=2, + ) + + _LOGGER.info("Migration to version %s successful", 2) return True return False +