summaryrefslogtreecommitdiffstats
path: root/src/discover.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/discover.py')
-rw-r--r--src/discover.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/discover.py b/src/discover.py
new file mode 100644
index 0000000..d0d13fe
--- /dev/null
+++ b/src/discover.py
@@ -0,0 +1,9 @@
+import asyncio
+from bleak import BleakScanner
+
+async def discover():
+ try:
+ devices = await BleakScanner.discover()
+ return [{"name": device.name, "address": device.address} for device in devices]
+ except Exception:
+ return [] \ No newline at end of file
git.ajschof.me — hosted by ajschofield — powered by cgit