From b8f2d501a5cc1c36692519ec6421512a9576028a Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Thu, 5 Jun 2025 07:40:57 +0200 Subject: [PATCH] Increased kwh resultion in plot json (#961) --- lib/SvelteUi/src/AmsWebServer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/SvelteUi/src/AmsWebServer.cpp b/lib/SvelteUi/src/AmsWebServer.cpp index ee0eebaf..a4243a8f 100644 --- a/lib/SvelteUi/src/AmsWebServer.cpp +++ b/lib/SvelteUi/src/AmsWebServer.cpp @@ -680,7 +680,7 @@ void AmsWebServer::dayplotJson() { } else { uint16_t pos = snprintf_P(buf, BufferSize, PSTR("{\"unit\":\"kwh\"")); for(uint8_t i = 0; i < 24; i++) { - pos += snprintf_P(buf+pos, BufferSize-pos, PSTR(",\"i%02d\":%.2f,\"e%02d\":%.2f"), i, ds->getHourImport(i) / 1000.0, i, ds->getHourExport(i) / 1000.0); + pos += snprintf_P(buf+pos, BufferSize-pos, PSTR(",\"i%02d\":%.3f,\"e%02d\":%.3f"), i, ds->getHourImport(i) / 1000.0, i, ds->getHourExport(i) / 1000.0); } snprintf_P(buf+pos, BufferSize-pos, PSTR("}")); @@ -703,7 +703,7 @@ void AmsWebServer::monthplotJson() { } else { uint16_t pos = snprintf_P(buf, BufferSize, PSTR("{\"unit\":\"kwh\"")); for(uint8_t i = 1; i < 32; i++) { - pos += snprintf_P(buf+pos, BufferSize-pos, PSTR(",\"i%02d\":%.2f,\"e%02d\":%.2f"), i, ds->getDayImport(i) / 1000.0, i, ds->getDayExport(i) / 1000.0); + pos += snprintf_P(buf+pos, BufferSize-pos, PSTR(",\"i%02d\":%.3f,\"e%02d\":%.3f"), i, ds->getDayImport(i) / 1000.0, i, ds->getDayExport(i) / 1000.0); } snprintf_P(buf+pos, BufferSize-pos, PSTR("}"));