How to resolve: FutureWarning: BLEDevice.metadata is deprecated and will be removed in a future version of Bleak, use AdvertisementData instead #1354
-
DescriptionI'm using the metadata field but being forewarned that it is on its way to deprecation. What I DidI read through #1025 but I could see a clear answer as to how to use AdvertisementData as they mentioned "we could add an optional parameter" so I am unsure if that has been implemented already. My code is currently:
I'm wondering how I could iterate through devices and find their respective advertisement data for this. LogsFutureWarning: BLEDevice.metadata is deprecated and will be removed in a future version of Bleak, use AdvertisementData instead |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 7 replies
-
As described in the docs, the https://bleak.readthedocs.io/en/latest/api/scanner.html#bleak.BleakScanner.discover |
Beta Was this translation helpful? Give feedback.
-
bleak version: 0.20.2 Hi, i use your code:
And I received an error:
Please what am i doing wrong? |
Beta Was this translation helpful? Give feedback.
-
No, i havent Strange name for a typo ;) |
Beta Was this translation helpful? Give feedback.
-
I think funtion return List[BLEDevice] for overload function , but why? |
Beta Was this translation helpful? Give feedback.
-
Thanks for your time |
Beta Was this translation helpful? Give feedback.
-
Can you help with a similar case:
Problem with:
and:
I get a return like this:
Full code: https://github.com/userx14/omblepy/blob/main/omblepy.py BR, |
Beta Was this translation helpful? Give feedback.
Can you give the full stack trace?
You can also simplify things a bit by changing
to
and by changing
adv_dat['manufacturer_data']
toadv_dat.manufacturer_data