Skip to content

Commit

Permalink
Fixed BleakScanner.discover() on older versions of macOS.
Browse files Browse the repository at this point in the history
Fixes hbldh#331
Fixes hbldh#352
  • Loading branch information
dlech committed Dec 7, 2020
1 parent 0a2a89c commit 4591364
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Fixed
-----

* Fixed use of bare exceptions.
* Fixed #374 "BleakClientBlueZDBus.start_notify() misses initial notifications with fast Bluetooth devices"
* Fixed #374 "BleakClientBlueZDBus.start_notify() misses initial notifications with fast Bluetooth devices".
* Fixed ``BleakScanner.discover()`` on older versions of macOS. Fixes #331.

Removed
~~~~~~~
Expand Down
4 changes: 3 additions & 1 deletion bleak/backends/corebluetooth/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import pathlib
from typing import Callable, Union, List

from Foundation import NSArray

from bleak.backends.corebluetooth.CentralManagerDelegate import CentralManagerDelegate
from bleak.backends.corebluetooth.utils import cb_uuid_to_str
from bleak.backends.device import BLEDevice
Expand Down Expand Up @@ -75,7 +77,7 @@ async def set_scanning_filter(self, **kwargs):
async def get_discovered_devices(self) -> List[BLEDevice]:
found = []
peripherals = self._manager.central_manager.retrievePeripheralsWithIdentifiers_(
self._identifiers.keys(),
NSArray(self._identifiers.keys()),
)

for i, peripheral in enumerate(peripherals):
Expand Down

0 comments on commit 4591364

Please sign in to comment.