Integrated test function

This commit is contained in:
Magnus Persson
2022-03-12 08:20:02 +01:00
parent d9c467d54f
commit 1bc3abc9f0
4 changed files with 65 additions and 78 deletions

View File

@ -799,14 +799,20 @@ void WebServerHandler::webHandleTestPush() {
enabled = true;
}
DynamicJsonDocument doc(20);
DynamicJsonDocument doc(100);
doc[PARAM_PUSH_ENABLED] = enabled;
doc[PARAM_PUSH_SUCCESS] = push.getLastSuccess();
doc[PARAM_PUSH_CODE] = push.getLastCode();
String out;
out.reserve(50);
out.reserve(100);
serializeJson(doc, out);
#if LOG_LEVEL == 6 && !defined(WEB_DISABLE_LOGGING)
serializeJson(doc, Serial);
Serial.print(CR);
#endif
_server->send(200, "application/json", out.c_str());
LOG_PERF_STOP("webserver-api-test-push");
}