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; } }