File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 1818Changed
1919-------
2020* Raise new ``BleakBluetoothNotAvailableError `` when Bluetooth is not supported, turned off or permission is denied.
21+ * Allow multiple calls to ``disconnect() `` on Windows to align behaviour over all backends.
2122
2223Fixed
2324-----
Original file line number Diff line number Diff line change @@ -465,7 +465,12 @@ async def disconnect(self) -> None:
465465 """Disconnect from the specified GATT server."""
466466 logger .debug ("Disconnecting from BLE device..." )
467467
468- assert self .services
468+ if self .services is None :
469+ # No connection exists. Either one hasn't been created or
470+ # we have already called disconnect and closed the gatt
471+ # connection.
472+ logger .debug ("already disconnected" )
473+ return
469474
470475 # Remove notifications.
471476 for handle , event_handler_token in list (self ._notification_callbacks .items ()):
You can’t perform that action at this time.
0 commit comments