interrupt full heat cycle when pump starts

This commit is contained in:
lukas 2021-03-31 17:46:36 +02:00
parent 39a8ecde85
commit 3a5f1a3a74

View File

@ -62,7 +62,10 @@ void Heating::init(unsigned mode, const SettingState *settings, HeatingInfoServi
});
mHeizungTicker.attach(10, [this]() {
// 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(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();
}
});
}
}