From b15b5ad9baaecfb5d53876fdd91b385e6873acc0 Mon Sep 17 00:00:00 2001 From: Smittix Date: Wed, 14 Jan 2026 14:20:41 +0000 Subject: [PATCH] Fix Bluetooth event type being overwritten by device type The bt_device event was including 'type': device.get('type') which overwrote the SSE event type 'bt_device' with 'ble', causing the frontend to not recognize the events. - Rename device type field from 'type' to 'device_type' in bt_device events - Update frontend to use device_type for display Co-Authored-By: Claude Opus 4.5 --- routes/tscm.py | 2 +- templates/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/tscm.py b/routes/tscm.py index a022fb9..42b3085 100644 --- a/routes/tscm.py +++ b/routes/tscm.py @@ -1143,7 +1143,7 @@ def _run_sweep( _emit_event('bt_device', { 'mac': mac, 'name': device.get('name', 'Unknown'), - 'type': device.get('type', ''), + 'device_type': device.get('type', ''), 'rssi': device.get('rssi', ''), 'is_threat': is_threat, 'is_new': not classification.get('in_baseline', False), diff --git a/templates/index.html b/templates/index.html index d51a5de..1eb006e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -10237,7 +10237,7 @@
${d.mac} ${d.rssi || '--'} dBm - ${d.type || 'Unknown'} + ${d.device_type || 'Unknown'}
${d.indicators && d.indicators.length > 0 ? `
${formatIndicators(d.indicators)}
` : ''} ${d.recommended_action && d.recommended_action !== 'monitor' ? `
Action: ${d.recommended_action}
` : ''}