Skip to content

Commit

Permalink
add vedirect to config import / export
Browse files Browse the repository at this point in the history
  • Loading branch information
helgeerbe committed Oct 20, 2022
1 parent 732ab3e commit 3617e9a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ bool ConfigurationClass::write()
}
}

JsonObject vedirect = doc.createNestedObject("vedirect");
vedirect["enabled"] = config.Vedirect_Enabled;
vedirect["updates_only"] = config.Vedirect_UpdatesOnly;
vedirect["poll_interval"] = config.Vedirect_PollInterval;

// Serialize JSON to file
if (serializeJson(doc, f) == 0) {
Serial.println("Failed to write file");
Expand Down Expand Up @@ -283,6 +288,11 @@ bool ConfigurationClass::readJson()
}
}

JsonObject vedirect = doc["vedirect"];
config.Vedirect_Enabled = vedirect["enabled"] | VEDIRECT_ENABLED;
config.Vedirect_UpdatesOnly = vedirect["updates_only"] | VEDIRECT_UPDATESONLY;
config.Vedirect_PollInterval = vedirect["poll_interval"] | VEDIRECT_POLL_INTERVAL;

f.close();
return true;
}
Expand Down

0 comments on commit 3617e9a

Please sign in to comment.