Fix legacy code conflicts and Bleak deprecation warning

- Add null checks to legacy refreshBtInterfaces() function
- Redirect to BluetoothMode.checkCapabilities() when available
- Fix Bleak deprecation: use AdvertisementData.connectable instead of device.metadata

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-21 15:56:04 +00:00
parent 5016327bc2
commit 187347e64b
2 changed files with 22 additions and 10 deletions

View File

@@ -164,7 +164,7 @@ class BleakScanner:
manufacturer_data=manufacturer_data,
service_uuids=list(adv_data.service_uuids) if adv_data.service_uuids else [],
service_data=service_data,
is_connectable=device.metadata.get('connectable', True) if hasattr(device, 'metadata') else True,
is_connectable=getattr(adv_data, 'connectable', True) if adv_data else True,
)