-
Notifications
You must be signed in to change notification settings - Fork 305
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
Labels
enhancement
New feature or request
Comments
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.
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 ofBLEDevice
andAdvertisementData
instead of just aBLEDevice
.The text was updated successfully, but these errors were encountered: