async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
    """Migrate old config entry if necessary."""
    _LOGGER.debug(f"async_migrate_entry {config_entry.version}")
    # Currently, no migration logic beyond ensuring version matches CONFIG_VERSION
    if config_entry.version < CONFIG_VERSION:
        _LOGGER.debug(f"Migrating config entry from version {config_entry.version} to {CONFIG_VERSION}")
        new_data = {**config_entry.data}
        new_data.pop('scan_frequency', None)
        new_data.pop('initial_lag_time', None)
        config_entry.version = CONFIG_VERSION
        hass.config_entries.async_update_entry(config_entry, data=new_data)
        _LOGGER.debug("Migration successful")
        return True
    return True
Migrate old config entry if necessary.
custom_components/ai_automation_suggester/__init__.py