You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to run BleakScanner.discover with the code from the readme and it fails saying that transmit_power_level_in_d_bm property is not available. I expected to print in the terminal every bluetooth devices around my computer.
What I Did
I tested the code with bleak version 0.18.0 and it worked.
import asyncio
from bleak import BleakScanner
async def main():
devices = await BleakScanner.discover()
for d in devices:
print(d)
asyncio.run(main())
Traceback (most recent call last):
File "C:\Users\tetl1201\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\tetl1201\AppData\Local\Programs\Python\Python39\lib\site-packages\bleak\backends\winrt\scanner.py", line 159, in _received_handler
if args.transmit_power_level_in_d_bm is not None:
AttributeError: property is not available in this version of Windows
Exception in callback BleakScannerWinRT._received_handler(<_bleak_winrt...0025957AACC90>, <_bleak_winrt...0025957AACA70>)
handle: <Handle BleakScannerWinRT._received_handler(<_bleak_winrt...0025957AACC90>, <_bleak_winrt...0025957AACA70>)>
Logs
2022-10-28 12:02:07,815 bleak.backends.winrt.scanner DEBUG: Received 6A:DF:59:88:3E:23: .
2022-10-28 12:02:07,816 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-10-28 12:02:07,935 bleak.backends.winrt.scanner DEBUG: Received 2E:BD:06:A7:C9:E8: .
Exception in callback BleakScannerWinRT._received_handler(<_bleak_winrt...001575BE9D2D0>, <_bleak_winrt...001575BE9D430>)
handle: <Handle BleakScannerWinRT._received_handler(<_bleak_winrt...001575BE9D2D0>, <_bleak_winrt...001575BE9D430>)>
Traceback (most recent call last):
File "C:\Users\tetl1201\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\tetl1201\AppData\Local\Programs\Python\Python39\lib\site-packages\bleak\backends\winrt\scanner.py", line 159, in _received_handler
if args.transmit_power_level_in_d_bm is not None:
AttributeError: property is not available in this version of Windows
2022-10-28 12:02:07,939 bleak.backends.winrt.scanner DEBUG: Received 79:C5:6F:B8:69:22: .
And these messages repeat for 5 seconds.
The text was updated successfully, but these errors were encountered:
The transmit power property of the advertising data was added in Windows
build 19041, so we need a fallback for older versions of Windows.
Fixeshbldh#1094
Description
I try to run BleakScanner.discover with the code from the readme and it fails saying that transmit_power_level_in_d_bm property is not available. I expected to print in the terminal every bluetooth devices around my computer.
What I Did
I tested the code with bleak version 0.18.0 and it worked.
Logs
2022-10-28 12:02:07,815 bleak.backends.winrt.scanner DEBUG: Received 6A:DF:59:88:3E:23: .
2022-10-28 12:02:07,816 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-10-28 12:02:07,935 bleak.backends.winrt.scanner DEBUG: Received 2E:BD:06:A7:C9:E8: .
2022-10-28 12:02:07,939 bleak.backends.winrt.scanner DEBUG: Received 79:C5:6F:B8:69:22: .
And these messages repeat for 5 seconds.
The text was updated successfully, but these errors were encountered: