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

deprecate BLEDevice.metadata and BLEDevice.rssi #1025

Closed
dlech opened this issue Sep 22, 2022 · 0 comments · Fixed by #1059
Closed

deprecate BLEDevice.metadata and BLEDevice.rssi #1025

dlech opened this issue Sep 22, 2022 · 0 comments · Fixed by #1059
Labels
enhancement New feature or request

Comments

@dlech
Copy link
Collaborator

dlech commented Sep 22, 2022

The BLEDevice.metadata attribute was added in the early days of bleak as a hack to get advertisement data from the simple BleakScanner discovery methods without having to add a callback. The rssi attribute was added later for the same reason.

However, the BLEDevice and the advertisement data really should be treated as separate objects. (In fact, it #1022 we are discussing using a BLEDevice where no advertisements are involved at all.)

To still be able to to get the last advertisement data from methods like BleakScanner.find_by_name(), we could add an optional parameter to these methods to change the return value. If the parameter is true, then it would return a tuple of BLEDevice and AdvertisementData instead of just a BLEDevice.

@dlech dlech added the enhancement New feature or request label Sep 22, 2022
@dlech dlech changed the title deprecate BLEDevice.metadata deprecate BLEDevice.metadata and BLEDevice.rssi Sep 22, 2022
dlech added a commit that referenced this issue Sep 30, 2022
This adds an `rssi` attribute to the AdvertisementData type.

This is done so we can eventually deprecate the `rssi` on the BLEDevice
object (#1025).

While we are touching this, also change AdvertisementData to a named
tuple so we don't have to initialize all of the values ourselves.
dlech added a commit that referenced this issue Sep 30, 2022
This adds an `rssi` attribute to the AdvertisementData type.

This is done so we can eventually deprecate the `rssi` on the BLEDevice
object (#1025).

While we are touching this, also change AdvertisementData to a named
tuple so we don't have to initialize all of the values ourselves.
dlech added a commit that referenced this issue Sep 30, 2022
This adds an `rssi` attribute to the AdvertisementData type.

This is done so we can eventually deprecate the `rssi` on the BLEDevice
object (#1025).

While we are touching this, also change AdvertisementData to a named
tuple so we don't have to initialize all of the values ourselves.
dlech added a commit that referenced this issue Sep 30, 2022
This adds an `rssi` attribute to the AdvertisementData type.

This is done so we can eventually deprecate the `rssi` on the BLEDevice
object (#1025).

While we are touching this, also change AdvertisementData to a named
tuple so we don't have to initialize all of the values ourselves.
dlech added a commit that referenced this issue Oct 3, 2022
This adds an `rssi` attribute to the AdvertisementData type.

This is done so we can eventually deprecate the `rssi` on the BLEDevice
object (#1025).

While we are touching this, also change AdvertisementData to a named
tuple so we don't have to initialize all of the values ourselves.
dlech added a commit that referenced this issue Oct 3, 2022
This make a clean separation between the BLEDevice which is the OS
handle for a "known" BLE device and the advertising data for that
device. There are now alternatives in place for getting advertising
data paired with the BLEDevice so we can deprecate these attributes.

Fixes #1025.
dlech added a commit that referenced this issue Oct 3, 2022
This make a clean separation between the BLEDevice which is the OS
handle for a "known" BLE device and the advertising data for that
device. There are now alternatives in place for getting advertising
data paired with the BLEDevice so we can deprecate these attributes.

Fixes #1025.
@dlech dlech closed this as completed in bcae937 Nov 6, 2022
@dlech dlech mentioned this issue Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant