From 5eba6914297db6b58ed4a8951da1cf79528767a8 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Thu, 10 Oct 2019 06:45:49 +0200 Subject: [PATCH] Extended the webinterface to list all available effects. --- src/http_server.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/http_server.cpp b/src/http_server.cpp index 6846230..3efdaec 100644 --- a/src/http_server.cpp +++ b/src/http_server.cpp @@ -42,7 +42,7 @@ void http_server_setup() { PGM_P text_plain = PSTR("text/plain"); http_server.on("/", HTTP_GET, [&](){ LOGln("HTTP * GET /"); - String message = "Pitrix

Pitrix

Settings

Known animations:

"; + String message = "Pitrix

Pitrix

Settings

Effect

Known animations:

"; if (!SPIFFS.begin()) { message += "No SPIFFS file system found."; } else { @@ -76,13 +76,23 @@ void http_server_setup() { } String name = http_server.arg("key"); uint16_t value = http_server.arg("value").toInt(); - + if (change_setting(name.c_str(), value)) { http_server.send(200, "text/plain", "OK"); } else { http_server.send(400, "text/plain", "Could not change setting."); } }); + http_server.on("/effects", HTTP_GET, [&]() { + String message = "Pitrix effects

Pitrix settings

Back to main page"; + for (int i=0; i