Correctly call self.close() in disconnected_callback for bleak (fixes #770)

This commit is contained in:
Ian McEwen
2025-06-09 11:52:23 -07:00
parent 3c2dd6f4ff
commit 9281c4a335

View File

@@ -174,7 +174,7 @@ class BLEInterface(MeshInterface):
# Bleak docs recommend always doing a scan before connecting (even if we know addr)
device = self.find_device(address)
client = BLEClient(device.address, disconnected_callback=lambda _: self.close)
client = BLEClient(device.address, disconnected_callback=lambda _: self.close())
client.connect()
client.discover()
return client