From 62cea9932e3bdde40ce1b3bc6b1f57a375b6a43c Mon Sep 17 00:00:00 2001 From: lukas Date: Sat, 6 Mar 2021 14:39:32 +0100 Subject: [PATCH] correct version parsing and float conversion of percent value --- .gitlab-ci.yml | 2 +- src/HeatingInfoService.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d79f142..06afd51 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ build: stage: build script: - "platformio run -e esp12e" - - vers=$(grep -Po '[0-9]*\.[0-9]*\.[0-9]*(?=\")' ./src/Pins.h) + - vers=$(grep -Po '[0-9]+\.[0-9]+\.[0-9]+[-0-9A-Za-z]*(?=\")' ./src/Pins.h) - mv .pio/build/esp12e/*.bin Pumpensteuerung-${vers}.bin artifacts: paths: diff --git a/src/HeatingInfoService.cpp b/src/HeatingInfoService.cpp index 1bf754f..ab072de 100644 --- a/src/HeatingInfoService.cpp +++ b/src/HeatingInfoService.cpp @@ -30,7 +30,7 @@ void HeatingInfoService::reply(AsyncWebServerRequest *request) { root["lastheatduration"] = lastheating == 0 ? 0 : lastheatend == 0 ? -1 : lastheatend - lastheating; root["totalheattime"] = this->totalHeatTime; - root["heattimepercent"] = this->totalHeatTime / Timer::getSystemSeconds(); + root["heattimepercent"] = (float)this->totalHeatTime / (float)Timer::getSystemSeconds(); response->setLength(); request->send(response);