Fix TSCM SDR device detection

SDRFactory.detect_devices() returns SDRDevice dataclass objects,
not dictionaries. Fixed to access attributes directly instead of
using .get() method.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-14 13:28:07 +00:00
parent 570710c556
commit 153336d757
+8 -6
View File
@@ -426,15 +426,17 @@ def get_tscm_devices():
try:
from utils.sdr import SDRFactory
sdr_list = SDRFactory.detect_devices()
for i, sdr in enumerate(sdr_list):
for sdr in sdr_list:
# SDRDevice is a dataclass with attributes, not a dict
devices['sdr_devices'].append({
'index': i,
'name': sdr.get('name', f'SDR Device {i}'),
'type': sdr.get('type', 'unknown'),
'serial': sdr.get('serial', '')
'index': sdr.index,
'name': sdr.name,
'type': sdr.sdr_type.value if hasattr(sdr.sdr_type, 'value') else str(sdr.sdr_type),
'serial': sdr.serial,
'driver': sdr.driver
})
except ImportError:
pass
logger.debug("SDR module not available")
except Exception as e:
logger.warning(f"Error detecting SDR devices: {e}")