Commit 9733421
committed
pybricksdev.ble: filter name is None in find_device()
A recent change in Bleak made this problem more apparent since it
happens nearly all of the time on Windows now. It is possible to get
an advertisement callback before the SCAN_RSP has been received in
which case there will be no local name yet. So we need to ignore those
responses and wait for one that does have the local name to ensure that
the found device has a useful .name attribute.
Fixes: https://github.com/orgs/pybricks/discussions/10101 parent f298716 commit 9733421
2 files changed
+12
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
0 commit comments