Resync with PR 1534

This commit is contained in:
jpirnay
2026-04-01 11:00:51 +02:00
parent 55fbe1817e
commit 9cdc1b8784
3 changed files with 19 additions and 22 deletions
-13
View File
@@ -143,19 +143,6 @@ bool JsonSettingsIO::loadSettings(CrossPointSettings& s, const char* json, bool*
applyLegacyStatusBarSettings(s);
}
// Legacy migration: sleepCoverOverlay was a Toggle (0=off, 1=on). Now it's a 4-way Enum:
// {WHITE(0), GRAY(1), BLACK(2), OFF(3)}. Translate old values before the generic loop clamps.
if (!doc["sleepCoverOverlay"].isNull()) {
uint8_t legacyOverlay = doc["sleepCoverOverlay"] | (uint8_t)0;
if (legacyOverlay == 0) {
s.sleepCoverOverlay = 3; // OFF
doc["sleepCoverOverlay"] = 3;
if (needsResave) *needsResave = true;
} else if (legacyOverlay == 1) {
s.sleepCoverOverlay = 1; // GRAY (old "on" = gray dither)
}
}
for (const auto& info : getSettingsList()) {
if (!info.key) continue;
// Dynamic entries (KOReader etc.) are stored in their own files — skip.