Closed ViViDboarder closed 1 year ago
It's worth noting that asyncio.get_event_loop()
is deprecated. The Python documentation shows this warning:
Deprecated since version 3.10: Deprecation warning is emitted if there is no running event loop. In future Python releases, this function will be an alias of
get_running_loop()
.
In the future when it does become an alias, it will fail to run if there is no running loop. At that point, using the async helper created here will work but other refactoring may be required to maintain current status quo.
This patch uses the BleakScanner interface to simplify the scanning as well as provide more means of connecting. With an address, a BLEDevice, or with a user provided scanner.
This change will allow me to implement a Home Assistant integration using Bluetooth discovery.
Other changes:
black