Browse Source

Only send websocket broadcasts when someone is connected

Thomas Buck 3 years 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
 }
49
 }
50
 
50
 
51
 void wifi_send_status_broadcast(void) {
51
 void wifi_send_status_broadcast(void) {
52
+    if (socket.connectedClients() <= 0) {
53
+        return;
54
+    }
55
+    
52
     String a = message_buffer_a ;
56
     String a = message_buffer_a ;
53
     String b = message_buffer_b;
57
     String b = message_buffer_b;
54
     String c = message_buffer_c;
58
     String c = message_buffer_c;

Loading…
Cancel
Save