Add more debug logging for BT stream connection

🤖 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:59:04 +00:00
parent 4aaaa94f9d
commit 197cd84f21

View File

@@ -6186,11 +6186,14 @@ def get_bt_devices():
@app.route('/bt/stream')
def stream_bt():
"""SSE stream for Bluetooth events."""
print("[BT Stream] Client connected")
def generate():
import json
print("[BT Stream] Generator started, waiting for queue...")
while True:
try:
msg = bt_queue.get(timeout=1)
print(f"[BT Stream] Got from queue: {msg.get('type')}")
if msg.get('type') == 'device':
print(f"[BT Stream] Sending device: {msg.get('mac')}")
yield f"data: {json.dumps(msg)}\n\n"