Skip to content

Commit

Permalink
fix: handle case where version is None in migration
Browse files Browse the repository at this point in the history
  • Loading branch information
bj00rn committed Nov 5, 2024
1 parent cd85d32 commit 31126c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/saleryd_hrv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 31126c2

Please sign in to comment.