diff --git a/Arduino/CanGrow/CanGrow_WebFunctions.h b/Arduino/CanGrow/CanGrow_WebFunctions.h index 704797a..302a3f7 100644 --- a/Arduino/CanGrow/CanGrow_WebFunctions.h +++ b/Arduino/CanGrow/CanGrow_WebFunctions.h @@ -852,6 +852,9 @@ void POSTgrowSettings() { void POSTsystemSettings() { + + unsigned short UseLEDrelais_old = UseLEDrelais; + unsigned short UseFANrelais_old = UseFANrelais; NtpOffset = webserver.arg("NtpOffset").toInt(); MoistureSensor_Type = webserver.arg("MoistureSensor_Type").toInt(); SoilmoistureLow = webserver.arg("SoilmoistureLow").toInt(); @@ -909,14 +912,14 @@ void POSTsystemSettings() { // when user uses an relais for LED control, we force here PinLEDPWM to 255 // to ensure nothing bad happens and its turned on - if(UseLEDrelais == false) { + if( (UseLEDrelais == false) && (UseLEDrelais != UseLEDrelais_old) ) { PinLEDPWM = 255; EEPROM.put(213, PinLEDPWM); EEPROM.commit(); Serial.println("UseLEDrelais is 0, forcing PinLEDPWM to max to prevent relais damage and ensure its turned on"); } - if(UseFANrelais == false) { + if( (UseFANrelais == false) && (UseFANrelais != UseFANrelais_old) ) { PinFANPWM = 255; EEPROM.put(215, PinFANPWM); EEPROM.commit();