Skip to content

Commit 6e8a81b

Browse files
author
gemi254
committed
Updated v1.0.4
1 parent 7bf6a0d commit 6e8a81b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

examples/ControlAssist-ToggleLed/ControlAssist-ToggleLed.ino

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,21 @@ void setup() {
206206

207207

208208
void loop() {
209+
#if not defined(ESP32)
210+
if(MDNS.isRunning()) MDNS.update(); //Handle MDNS
211+
#endif
212+
//Handler webserver clients
213+
server.handleClient();
214+
//Handle websockets
215+
ctrl.loop();
216+
209217
if (millis() - pingMillis >= 5000){
210218
ledState = !ledState;
211219
toggleLed(ledState);
212220
//Set the ledState and send a websocket update
213221
ctrl.put("toggleLed", ledState );
214222
pingMillis = millis();
215-
}
216-
ctrl.loop();
217-
server.handleClient();
223+
}
218224
}
219225

220226

0 commit comments

Comments
 (0)