15min refresh time between heats
This commit is contained in:
parent
94b635252d
commit
ffb62b9297
@ -9,7 +9,7 @@ void Heating::init(Temperature *tempsensor, unsigned mode) {
|
|||||||
switch (mode) {
|
switch (mode) {
|
||||||
case TIME: {
|
case TIME: {
|
||||||
const unsigned percentOn = 20;
|
const unsigned percentOn = 20;
|
||||||
const unsigned refreshperiod = 60;
|
const unsigned refreshperiod = 900;
|
||||||
|
|
||||||
const auto func = [this]() {
|
const auto func = [this]() {
|
||||||
mLuefterTicker.detach();
|
mLuefterTicker.detach();
|
||||||
@ -20,13 +20,13 @@ void Heating::init(Temperature *tempsensor, unsigned mode) {
|
|||||||
|
|
||||||
Serial.println("Turning on heating");
|
Serial.println("Turning on heating");
|
||||||
|
|
||||||
mTurnOffTicker.once(refreshperiod * percentOn / 100, []() {
|
mTurnOffTicker.once((int)((float)refreshperiod * (float)percentOn / 100.0), []() {
|
||||||
digitalWrite(HeizungPin, LOW);
|
digitalWrite(HeizungPin, LOW);
|
||||||
|
|
||||||
Serial.println("Turned off heating!");
|
Serial.println("Turned off heating!");
|
||||||
});
|
});
|
||||||
|
|
||||||
mLuefterTicker.once((refreshperiod * percentOn / 100) + 30, []() {
|
mLuefterTicker.once((int)(((float)refreshperiod * (float)percentOn / 100.0) + 30.0), []() {
|
||||||
digitalWrite(LuefterPin, LOW);
|
digitalWrite(LuefterPin, LOW);
|
||||||
|
|
||||||
Serial.println("Turned off fan!");
|
Serial.println("Turned off fan!");
|
||||||
@ -34,7 +34,7 @@ void Heating::init(Temperature *tempsensor, unsigned mode) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
func();
|
func();
|
||||||
mHeizungTicker.attach(60, func);
|
mHeizungTicker.attach(refreshperiod, func);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case HUMIDITY:
|
case HUMIDITY:
|
||||||
|
Loading…
Reference in New Issue
Block a user