diff --git a/custom_components/saleryd_hrv/__init__.py b/custom_components/saleryd_hrv/__init__.py index ddcbc6f..b601e4e 100644 --- a/custom_components/saleryd_hrv/__init__.py +++ b/custom_components/saleryd_hrv/__init__.py @@ -40,7 +40,11 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Migrate config entry.""" - if entry.version == 1: + if entry.version is not None and entry.version > CONFIG_VERSION: + # This means the user has downgraded from a future version + return False + + if entry.version is None or entry.version == 1: new_data = entry.data.copy() new_data |= { CONF_ENABLE_MAINTENANCE_SETTINGS: False,