mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 14:50:00 -07:00
Fix API/frontend field name mismatches
- Add 'available' alias for 'can_scan' in capabilities - Add 'preferred_backend' alias for 'recommended_backend' - Add 'id' field to adapter info for frontend compatibility Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -130,6 +130,7 @@ def _check_adapters(caps: SystemCapabilities) -> None:
|
||||
if 'org.bluez.Adapter1' in interfaces:
|
||||
adapter_props = interfaces['org.bluez.Adapter1']
|
||||
adapter_info = {
|
||||
'id': str(path), # Alias for frontend
|
||||
'path': str(path),
|
||||
'name': str(adapter_props.get('Name', 'Unknown')),
|
||||
'address': str(adapter_props.get('Address', 'Unknown')),
|
||||
@@ -168,9 +169,11 @@ def _check_adapters_hciconfig(caps: SystemCapabilities) -> None:
|
||||
# Match adapter line (e.g., "hci0: Type: Primary Bus: USB")
|
||||
adapter_match = re.match(r'^(hci\d+):', line)
|
||||
if adapter_match:
|
||||
adapter_name = adapter_match.group(1)
|
||||
current_adapter = {
|
||||
'path': f'/org/bluez/{adapter_match.group(1)}',
|
||||
'name': adapter_match.group(1),
|
||||
'id': adapter_name, # Alias for frontend
|
||||
'path': f'/org/bluez/{adapter_name}',
|
||||
'name': adapter_name,
|
||||
'address': 'Unknown',
|
||||
'powered': False,
|
||||
'discovering': False,
|
||||
|
||||
Reference in New Issue
Block a user