Skip to content

Commit 9b4f124

Browse files
committed
Add status http request (#8)
Fixes #8
1 parent fa3687e commit 9b4f124

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/FWebserver.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ namespace Webserver
5050
FastLEDHub.restart();
5151
ESPEssentials::WebServer.send(200, "text/plain", "Animation restarted.");
5252
});
53+
ESPEssentials::WebServer.on("/status", HTTP_GET, [&]()
54+
{
55+
String statusMsg = "{\"status\": " + String((int) FastLEDHub.getStatus()) + ", \"currentAnimation\": \"" + FastLEDHub.getCurrentAnimationName() + "\"}";
56+
ESPEssentials::WebServer.send(200, "text/plain", statusMsg.c_str());
57+
});
5358
ESPEssentials::WebServer.on("/begin", HTTP_GET, [&]()
5459
{
5560
if (ESPEssentials::WebServer.hasArg("animation"))

0 commit comments

Comments
 (0)