Skip to content

Commit af0a962

Browse files
authored
Fixed BLE connections to Hubs under macOS 12 (#26)
Addresses #23.
1 parent c6eb260 commit af0a962

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

CONTRIBUTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,20 @@ Python VS Code extension so that it does not modify the `.vscode/settings.json`
3636
file in the project when you select the interpreter.
3737

3838
[DeprecatePythonPath]: https://github.com/microsoft/vscode-python/wiki/AB-Experiments#deprecatepythonpath
39+
40+
### Test your changes
41+
42+
#### Run a script on your Hub
43+
44+
poetry run pybricksdev run ble test.py
45+
46+
#### Build and install your changes globally
47+
48+
poetry build
49+
pipx install --force ./dist/pybricksdev-1.0.0a19.tar.gz
50+
51+
#### Inject a custom dependency
52+
53+
For instance, if you want the installed `pybricksdev` to use code from the `develop` branch of the `bleak` package.
54+
55+
pipx inject pybricksdev https://github.com/hbldh/bleak/archive/refs/heads/develop.zip

pybricksdev/ble/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def match_uuid_and_name(device: BLEDevice, adv: AdvertisementData):
5454

5555
return True
5656

57-
device = await BleakScanner.find_device_by_filter(match_uuid_and_name, timeout)
57+
device = await BleakScanner.find_device_by_filter(
58+
match_uuid_and_name, timeout, service_uuids=[service]
59+
)
5860

5961
if device is None:
6062
raise asyncio.TimeoutError

0 commit comments

Comments
 (0)