diff --git a/src/Heating.cpp b/src/Heating.cpp index 53ae6ab..ea25d59 100644 --- a/src/Heating.cpp +++ b/src/Heating.cpp @@ -62,7 +62,10 @@ void Heating::init(unsigned mode, const SettingState *settings, HeatingInfoServi }); mHeizungTicker.attach(10, [this]() { - sensor.read(); + // only check if no pump cycle is active + if (!mPumpCycleActive) { + sensor.read(); + } }); break; @@ -78,10 +81,8 @@ void Heating::handleHeatingEvents() { // turn off active turnoff timers mLuefterTicker.detach(); //Serial.println("heating should run now!"); - // turn on heating and fan - if (!mPumpCycleActive) { - digitalWrite(LuefterPin, HIGH); - } + + digitalWrite(LuefterPin, HIGH); digitalWrite(HeizungPin, HIGH); @@ -150,9 +151,21 @@ void Heating::setPumCycleActive(bool active) { // turn off fan if pumpcycleactive if (active) { digitalWrite(LuefterPin, LOW); - } else { + digitalWrite(HeizungPin, LOW); + + mHeizungTicker.detach(); + if (mHeatingStatus) { - digitalWrite(LuefterPin, HIGH); + // to add the correct time to the heat min counter! + mheatingservice->addHeatTime(Timer::getSystemSeconds() - mheatingservice->getLastHeatingStartTime()); } + } else { + mHeizungTicker.detach(); + mHeizungTicker.attach(10, [this]() { + // only check if no pump cycle is active + if (!mPumpCycleActive) { + sensor.read(); + } + }); } }