Add debug logging for BT queue and stream

Added debug prints to trace device flow:
- "[BT] Queuing device:" when adding to queue
- "[BT Stream] Sending device:" when SSE sends to client

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
James Smith
2025-12-21 14:57:31 +00:00
parent fa8c44c0bf
commit 4aaaa94f9d

View File

@@ -5756,11 +5756,13 @@ def stream_bt_scan(process, scan_mode):
is_new = mac not in bt_devices
bt_devices[mac] = device
bt_queue.put({
queue_data = {
'type': 'device',
'action': 'new' if is_new else 'update',
**device
})
}
print(f"[BT] Queuing device: {mac} - {name}")
bt_queue.put(queue_data)
except OSError:
break
@@ -6189,6 +6191,8 @@ def stream_bt():
while True:
try:
msg = bt_queue.get(timeout=1)
if msg.get('type') == 'device':
print(f"[BT Stream] Sending device: {msg.get('mac')}")
yield f"data: {json.dumps(msg)}\n\n"
except queue.Empty:
yield f"data: {json.dumps({'type': 'keepalive'})}\n\n"