@@ -187,6 +187,7 @@ void wallPanelEmulatorLoop(){
187187}
188188
189189void gdoStateLoop (){
190+ blink (false );
190191 if (!swSerial.available ()) return ;
191192 uint8_t serData = swSerial.read ();
192193
@@ -531,7 +532,7 @@ void manageHardwareButton(){
531532
532533/* ********************************* MQTT CALLBACK *****************************************/
533534void callback (char *topic, byte *payload, unsigned int length){
534-
535+ blink ( true );
535536 // Transform all messages in a JSON format
536537 StaticJsonDocument<BUFFER_SIZE> json = bootstrapManager.parseQueueMsg (topic, payload, length);
537538
@@ -631,6 +632,19 @@ void pullLow(){
631632 digitalWrite (OUTPUT_GDO, LOW);
632633}
633634
635+ void blink (bool trigger){
636+ if (LED_BUILTIN == OUTPUT_GDO) return ;
637+ static unsigned int onMillis = 0 ;
638+ unsigned int currentMillis = millis ();
639+
640+ if (trigger){
641+ digitalWrite (LED_BUILTIN,LOW);
642+ onMillis = currentMillis;
643+ }else if (currentMillis - onMillis > 500 ){
644+ digitalWrite (LED_BUILTIN,HIGH);
645+ }
646+ }
647+
634648void sync (){
635649 if (controlProtocol != " secplus2" ){
636650 Serial.println (" sync only needed with security+ 2.0" );
0 commit comments