Allow migrating configuration on update

This commit is contained in:
iranl
2024-02-16 20:06:42 +01:00
parent 21159fa8a9
commit ccec9055ee
2 changed files with 18 additions and 2 deletions

View File

@@ -147,6 +147,21 @@ bool initPreferences()
preferences->putBool(preference_started_before, true);
preferences->putBool(preference_lock_enabled, true);
}
else
{
int configVer = preferences->getInt(preference_config_version);
if(configVer < (atof(NUKI_HUB_VERSION) * 100))
{
//Example
//if (configVer < 833)
//{
//MIGRATE SETTINGS
//}
preferences->putInt(preference_config_version, atof(NUKI_HUB_VERSION) * 100);
}
}
return firstStart;
}