Browse Source

Only send websocket broadcasts when someone is connected

Thomas Buck 3 weeks ago
parent
commit
10e1c8bab5
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/WifiStuff.cpp

+ 4
- 0
src/WifiStuff.cpp View File

@@ -49,6 +49,10 @@ void wifi_schedule_websocket(void) {
49 49
 }
50 50
 
51 51
 void wifi_send_status_broadcast(void) {
52
+    if (socket.connectedClients() <= 0) {
53
+        return;
54
+    }
55
+    
52 56
     String a = message_buffer_a ;
53 57
     String b = message_buffer_b;
54 58
     String c = message_buffer_c;

Loading…
Cancel
Save