detach before call

This commit is contained in:
lukas 2021-04-01 17:33:57 +02:00
parent 9c782879a5
commit 6adfb3c09e

View File

@ -108,6 +108,8 @@ void WasserSensorCheck() {
status.detach();
wateroutagewaitduration = settingsservice.getSettings()->waterOutageWaitDuration;
status.detach();
status.attach(5, []() {
wateroutagewaitduration -= 5;
Serial.print("noch ");
@ -115,6 +117,7 @@ void WasserSensorCheck() {
Serial.println(" Sekunden verbleibend");
if (wateroutagewaitduration <= 0) {
status.detach();
if (digitalRead(WasserSensorPin)) {
allow = true;
Serial.println("Einschalten der Pumpe wieder erlaubt.");
@ -125,7 +128,6 @@ void WasserSensorCheck() {
Serial.print("wassersensor immer noch kein Wasser --> verlaengern um 120min\n\n");
WasserSensorCheck();
}
status.detach();
}
});
} else {