correct version parsing
and float conversion of percent value
This commit is contained in:
		| @@ -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: | ||||
|   | ||||
| @@ -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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user