Toggle Sensor LED to visualize mode 3

This commit is contained in:
Ollo 2020-11-01 20:42:45 +01:00
parent 89070806f7
commit 329a228b2d

View File

@ -475,7 +475,6 @@ int determineNextPump(){
*/ */
bool aliveHandler(const HomieRange& range, const String& value) { bool aliveHandler(const HomieRange& range, const String& value) {
if (range.isRange) return false; // only one controller is present if (range.isRange) return false; // only one controller is present
Serial << value << endl;
if (value.equals("ON") || value.equals("On") || value.equals("1")) { if (value.equals("ON") || value.equals("On") || value.equals("1")) {
mode3Active=true; mode3Active=true;
} else { } else {
@ -674,4 +673,9 @@ void loop() {
Serial.flush(); Serial.flush();
espDeepSleepFor(rtcDeepSleepTime); espDeepSleepFor(rtcDeepSleepTime);
} }
/* Toggel Senor LED to visualize mode 3 */
if (mode3Active && (millis() % 100) == 0) {
digitalWrite(OUTPUT_SENSOR, ! digitalRead(OUTPUT_SENSOR));
}
} }