From b7e0872f05d410ba0f71741cb31a6591bf84b936 Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 13 Feb 2023 10:18:18 -0600 Subject: [PATCH] [ONOFF] Set power indicator status at start (#1456) So that it reflects the real state of the relay even if a restart of the board was done --- main/ZactuatorONOFF.ino | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main/ZactuatorONOFF.ino b/main/ZactuatorONOFF.ino index a76cd69..6523a8d 100644 --- a/main/ZactuatorONOFF.ino +++ b/main/ZactuatorONOFF.ino @@ -38,6 +38,11 @@ void setupONOFF() { xTaskCreate(overLimitTemp, "overLimitTemp", 2500, NULL, 10, NULL); # endif pinMode(ACTUATOR_ONOFF_GPIO, OUTPUT); + if (digitalRead(ACTUATOR_ONOFF_GPIO) == ACTUATOR_ON) { + PowerIndicatorON(); + } else { + PowerIndicatorOFF(); + } # ifdef ACTUATOR_ONOFF_DEFAULT digitalWrite(ACTUATOR_ONOFF_GPIO, ACTUATOR_ONOFF_DEFAULT); # endif