Added average runtime + voltage to device page

This commit is contained in:
Magnus Persson
2022-01-31 18:29:27 +01:00
parent 22ade61af8
commit 761d570d39
7 changed files with 23 additions and 5 deletions

View File

@ -50,6 +50,11 @@ void WebServerHandler::webHandleDevice() {
doc[PARAM_APP_NAME] = CFG_APPNAME;
doc[PARAM_APP_VER] = CFG_APPVER;
doc[PARAM_MDNS] = myConfig.getMDNS();
doc[PARAM_BATTERY] = reduceFloatPrecision(myBatteryVoltage.getVoltage());
FloatHistoryLog runLog(RUNTIME_FILENAME);
doc[PARAM_RUNTIME_AVERAGE] = reduceFloatPrecision(runLog.getAverage()?runLog.getAverage()/1000:0, 1);
#if LOG_LEVEL == 6
serializeJson(doc, Serial);
Serial.print(CR);