Add more debug logging for device types and manufacturers

- Log device_type in updateBtTypeChart to see what values are received
- Log manufacturer in updateBtManufacturerList
- This will help diagnose why types/manufacturers aren't showing

🤖 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 15:19:48 +00:00
parent 9a4ac90b5a
commit 478fffd288
+4
View File
@@ -4129,12 +4129,14 @@ HTML_TEMPLATE = '''
Object.values(btDevices).forEach(d => { Object.values(btDevices).forEach(d => {
const devType = d.device_type || 'other'; const devType = d.device_type || 'other';
console.log('[CHART] Device:', d.mac, 'device_type:', d.device_type, 'resolved:', devType);
if (d.tracker) trackers++; if (d.tracker) trackers++;
else if (devType === 'phone') phones++; else if (devType === 'phone') phones++;
else if (devType === 'audio') audio++; else if (devType === 'audio') audio++;
else if (devType === 'wearable') wearables++; else if (devType === 'wearable') wearables++;
else other++; else other++;
}); });
console.log('[CHART] Totals - phones:', phones, 'audio:', audio, 'wearables:', wearables, 'trackers:', trackers, 'other:', other);
document.getElementById('btPhoneCount').textContent = phones; document.getElementById('btPhoneCount').textContent = phones;
document.getElementById('btAudioCount').textContent = audio; document.getElementById('btAudioCount').textContent = audio;
@@ -4192,10 +4194,12 @@ HTML_TEMPLATE = '''
const manufacturers = {}; const manufacturers = {};
Object.values(btDevices).forEach(d => { Object.values(btDevices).forEach(d => {
const m = d.manufacturer || 'Unknown'; const m = d.manufacturer || 'Unknown';
console.log('[MFR] Device:', d.mac, 'manufacturer:', d.manufacturer, 'resolved:', m);
manufacturers[m] = (manufacturers[m] || 0) + 1; manufacturers[m] = (manufacturers[m] || 0) + 1;
}); });
const sorted = Object.entries(manufacturers).sort((a, b) => b[1] - a[1]).slice(0, 6); const sorted = Object.entries(manufacturers).sort((a, b) => b[1] - a[1]).slice(0, 6);
console.log('[MFR] Sorted manufacturers:', sorted);
const list = document.getElementById('btManufacturerList'); const list = document.getElementById('btManufacturerList');
if (sorted.length === 0) { if (sorted.length === 0) {