mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-05-04 04:22:42 +02:00
bleak inside Docker cannot initiate new BLE connections — it can only take over connections already established by BlueZ. Replace the force-disconnect approach with a connect-via-BlueZ approach: 1. _ble_ensure_connected() connects the device via BlueZ D-Bus (Device1.Connect) before bleak tries to take over 2. BleakScanner.find_device_by_address() provides the BLEDevice object that bleak 3.x needs (raw MAC address doesn't work) 3. MeshCore.create_ble(device=...) takes over the BlueZ connection On reconnect after disconnect: 1. Power-cycle adapter clears stale GATT notification handles 2. BlueZ re-connects the trusted device automatically 3. bleak takes over the re-established connection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>