Skip to content

Commit

Permalink
fix: add to as
Browse files Browse the repository at this point in the history
  • Loading branch information
Friedjof committed May 22, 2024
1 parent a50c874 commit 51cb507
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions data-template/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ async function saveTimers() {
list_timers.push(timers[i]);
}

console.log(list_timers);

await fetch(url + '/set', {
method: 'POST',
headers: {
Expand Down
2 changes: 1 addition & 1 deletion lib/ConfigManager/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void ConfigManager::get_timers_json(JsonDocument &json)
{
this->load_config();

JsonArray timers = json["timers"].add<JsonArray>();
JsonArray timers = json["timers"].to<JsonArray>();

for (size_t i = 0; i < this->config.timer_list.num_timers && i <= MAX_TIMERS; i++)
{
Expand Down
3 changes: 1 addition & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,9 @@ void setup()
loggingManager.log(LOG_LEVEL_INFO, "GET /get");

String jsonString;

JsonDocument json;
configManager.get_timers_json(json);

configManager.get_timers_json(json);
serializeJson(json, jsonString);

json.clear();
Expand Down

0 comments on commit 51cb507

Please sign in to comment.