Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed separate implementation of global discover method. #387

Merged
merged 3 commits into from
Dec 9, 2020

Conversation

dlech
Copy link
Collaborator

@dlech dlech commented Dec 8, 2020

The "old" discover() method was largely duplicating the code from BleackScanner.discover(), with the exception of the Mac backend which looked like it might not even work correctly and ignored kwargs.

Rather than trying to maintain two separate implementations that are supposed to dot he same thing, this removes the discover() method from the documentation and removes the separate implementation. The name is still kept and made as a synonym for for BleakScanner.discover so that we don't completely break existing code that might be using it.

This adds a more informative error message for unsupported platforms. Previously the if block would fall through which would likely cause `AttributeError`s or `ImportError`s.
The "old" `discover()` method was largely duplicating the code from `BleackScanner.discover()`, with the exception of the Mac backend which looked like it might not even work correctly and ignored kwargs.

This removes the `discover()` method from the documentation and removes the separate implementation. The name is still kept and made as a synonym for for `BleakScanner.discover` so that we don't completely break existing code that might be using it.
…ed first.

This adds an `from BleakBridge import Bridge` to all files that use winrt bindings. This ensures that imports work no matter which module is imported first.
@hbldh
Copy link
Owner

hbldh commented Dec 9, 2020

Yes. I meant to do this when I implemented the scanner, but I decided to wait until I was sure it was stable. Then I forgot it. Well done!

@dlech dlech merged commit f5be921 into develop Dec 9, 2020
@dlech dlech deleted the discovery-refactor branch December 9, 2020 15:25
dlech added a commit that referenced this pull request Dec 11, 2020
Use `BleakScanner.discover` instead of "old" `discover`. (follow up of #387)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants