ai added lifespans
This commit is contained in:
+3
-2
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user