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

Don't use bluetoothctl #798

Closed
kq98 opened this issue Apr 6, 2022 · 2 comments
Closed

Don't use bluetoothctl #798

kq98 opened this issue Apr 6, 2022 · 2 comments
Assignees
Labels
Backend: BlueZ Issues and PRs relating to the BlueZ backend dependencies Pull requests that update a dependency file enhancement New feature or request

Comments

@kq98
Copy link

kq98 commented Apr 6, 2022

  • bleak version: 0.14.2
  • Python version: 3
  • Operating System: GNU/Linux
  • BlueZ version: 5.60

Description

Trying to use bleak inside a Flatpak sandbox fails because bluetoothctl, like all other system utils, can't be accessed.

Inside the bluezdbus backend in __init__.py a bluetoothctl subprocess is spawned to get the current bluez version.
I suggest to use the bluez dbus interface directly to get the version.

@hbldh
Copy link
Owner

hbldh commented Apr 6, 2022

I am pretty sure there is no such thing available in the dbus api for BlueZ. At least there wasn't when Bleak was written.

It is regrettable that bluetoothctl is needed there, and I would like to remove it if possible.

Simplest solution for you would be to modify the init file to have your version hard coded, for this very specific use case.

@hbldh hbldh self-assigned this Apr 6, 2022
@hbldh hbldh added Backend: BlueZ Issues and PRs relating to the BlueZ backend dependencies Pull requests that update a dependency file enhancement New feature or request labels Apr 6, 2022
@dlech
Copy link
Collaborator

dlech commented Mar 18, 2023

This was fixed by #907 by not crashing if bluetoothctl is not available.

@dlech dlech closed this as completed Mar 18, 2023
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 dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants