Add new UI!

This commit is contained in:
cschwinne
2019-12-05 01:58:03 +01:00
parent 173c752d62
commit d6c0642a02
8 changed files with 2799 additions and 2487 deletions

View File

@@ -90,6 +90,15 @@ bool deserializeState(JsonObject root)
int cy = root["pl"] | -1;
presetCyclingEnabled = (cy >= 0);
JsonObject ccnf = root["ccnf"];
presetCycleMin = ccnf["min"] | presetCycleMin;
presetCycleMax = ccnf["max"] | presetCycleMax;
tr = ccnf["time"] | -1;
if (tr >= 2)
{
presetCycleTime = tr;
presetCycleTime *= 100;
}
JsonObject nl = root["nl"];
nightlightActive = nl["on"] | nightlightActive;
@@ -183,6 +192,12 @@ void serializeState(JsonObject root)
root["ps"] = currentPreset;
root["pss"] = savedPresets;
root["pl"] = (presetCyclingEnabled) ? 0: -1;
//temporary for preser cycle
JsonObject ccnf = root.createNestedObject("ccnf");
ccnf["min"] = presetCycleMin;
ccnf["max"] = presetCycleMax;
ccnf["time"] = presetCycleTime/100;
JsonObject nl = root.createNestedObject("nl");
nl["on"] = nightlightActive;