From bef0bb816c7baa2eed59023c8cbf2c904af9bebb Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Tue, 10 Oct 2023 09:57:46 +0200 Subject: [PATCH] runningTime is now the time for every state --- lib/Pump/pump.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/Pump/pump.cpp b/lib/Pump/pump.cpp index aa7f984..8a6e627 100644 --- a/lib/Pump/pump.cpp +++ b/lib/Pump/pump.cpp @@ -80,9 +80,6 @@ void Pump::clearError() { } uint32_t Pump::getRunningTime() const { - if (this->state == State::Off) - return 0; - return (millis() - this->startTime) / 1000; } @@ -138,9 +135,9 @@ bool Pump::checkSensorsValues() { void Pump::handlePins(bool state) { digitalWrite(this->pumpPin, state); digitalWrite(this->ledPin, state); + this->startTime = millis(); if (state) { this->timerStandby = false; - this->startTime = millis(); this->maxPressureStart = 0; } }