ai added lifespans

This commit is contained in:
2026-02-06 09:51:22 +01:00
parent 88bf1e3bb2
commit 3695f1e139
4 changed files with 61 additions and 23 deletions
+3 -2
View File
@@ -103,6 +103,7 @@ void handleText() {
String colorStr = server.arg("color");
String position = server.arg("position");
unsigned char slowness = server.arg("slowness").toInt();
short disappear_time = server.hasArg("disappear") ? server.arg("disappear").toInt() : -1;
char text[TEXT_MAX_LENGTH + 1];
text_str.toCharArray(text, TEXT_MAX_LENGTH + 1);
@@ -110,9 +111,9 @@ void handleText() {
uint32_t color = strtol(colorStr.substring(1).c_str(), NULL, 16);
if (position == "top") {
addNewTextNode(text, color, false, 43, 0, slowness, true, false);
addNewTextNode(text, color, false, 43, 0, slowness, true, false, disappear_time);
} else if (position == "bottom") {
addNewTextNode(text, color, false, -text_str.length() * 6, 9, slowness, true, false);
addNewTextNode(text, color, false, -text_str.length() * 6, 9, slowness, true, false, disappear_time);
}
server.send(200, "text/plain", "OK");