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

BlueZ or_patterns are not type checked #1149

Open
dlech opened this issue Nov 26, 2022 · 0 comments
Open

BlueZ or_patterns are not type checked #1149

dlech opened this issue Nov 26, 2022 · 0 comments
Labels
Backend: BlueZ Issues and PRs relating to the BlueZ backend enhancement New feature or request

Comments

@dlech
Copy link
Collaborator

dlech commented Nov 26, 2022

  • bleak version: 0.20.0a1
  • Python version: 3.10
  • Operating System: Linux
  • BlueZ version (bluetoothctl -v) in case of Linux: 5.63

Description

When using passive scanning, or_patters are currently required for the BlueZ backend because that seems the only way to get BlueZ to do passive scanning. When we do this, we register a new D-Bus object and the or_patterns are read as a D-Bus property. If we get the types wrong, dbus-fast logs an error, but there is no way to raise an exception since it is happening in a background task.

With #1146, we can get a callback that there was a problem, but no way to tell what the problem is. So it would be better if we did a type check during __init__ of the BleakScanner instead to get an early failure and a more helpful error message.

@dlech dlech added Backend: BlueZ Issues and PRs relating to the BlueZ backend enhancement New feature or request labels Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend: BlueZ Issues and PRs relating to the BlueZ backend enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant