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

rename "device" to "adapter" #381

Closed
dlech opened this issue Dec 7, 2020 · 2 comments · Fixed by #383
Closed

rename "device" to "adapter" #381

dlech opened this issue Dec 7, 2020 · 2 comments · Fixed by #383
Labels
Backend: BlueZ Issues and PRs relating to the BlueZ backend

Comments

@dlech
Copy link
Collaborator

dlech commented Dec 7, 2020

  • bleak version: develop
  • Python version: N/A
  • Operating System: N/A
  • BlueZ version (bluetoothctl -v) in case of Linux: N/A

Description

There are places in the code where we use a device keyword argument to specify the the Bluetooth adapter to use to connect to a Bluetooth device.

I find this rather confusing since the term "device" is used in most places to mean a remote Bluetooth device. The term "adapter" seems to be the standard nomenclature for the local Bluetooth radio.

It would be nice to rename this argument to be less confusing. We can still check for the old name too so that we don't break existing code.

@dhalbert
Copy link

dhalbert commented Dec 7, 2020

Here is some previous related discussion: #285 (comment)

@hbldh
Copy link
Owner

hbldh commented Dec 7, 2020

Yes, I agree. I do not know why I used device in the first place. I ought to have used adapter, as was used in e.g. gatttool which I used prior to this, but it seems I confused the two somehow while implementing.

The #360 is a current issue related to this. This row should be changed to

scanner = cls(timeout=timeout, **kwargs)

to be able to connect with anything else than hci0. Had it been called adapter from the start, I don't think this would have slipped past...

@dlech dlech added the Backend: BlueZ Issues and PRs relating to the BlueZ backend label Dec 7, 2020
@dlech dlech mentioned this issue Dec 11, 2020
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants