Skip to content

How to resolve: FutureWarning: BLEDevice.metadata is deprecated and will be removed in a future version of Bleak, use AdvertisementData instead #1354

Answered by dlech
CalebDueck asked this question in Q&A
Discussion options

You must be logged in to vote

Can you give the full stack trace?

You can also simplify things a bit by changing

            for key, dev_and_adv_dat in discovered_devices_and_advertisement_data.items():
               device = dev_and_adv_dat[0]
               adv_dat = dev_and_adv_dat[1]

to

for device, adv_data in discovered_devices_and_advertisement_data.values():

and by changing adv_dat['manufacturer_data'] to adv_dat.manufacturer_data

Replies: 6 comments 7 replies

Comment options

You must be logged in to vote
3 replies
@CalebDueck
Comment options

@dlech
Comment options

Answer selected by dlech
@CalebDueck
Comment options

Comment options

You must be logged in to vote
1 reply
@dlech
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@dlech
Comment options

@dave-code-ruiz
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dlech
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #1353 on June 29, 2023 14:29.