diff options
| author | Alex Schofield <git@ajschof.me> | 2025-02-07 14:42:49 +0000 |
|---|---|---|
| committer | Alex Schofield <git@ajschof.me> | 2025-02-07 14:42:49 +0000 |
| commit | 3d5fb6e074f11466bf40ce8f65f4dab4a475b0ce (patch) | |
| tree | db542f8da5e161f3176afc86375210890e4a0b5b /src | |
| parent | 33ae211e45e6cfe0b7f0c89e98b4dbc79ae86a33 (diff) | |
| download | tp-logger-3d5fb6e074f11466bf40ce8f65f4dab4a475b0ce.tar.gz tp-logger-3d5fb6e074f11466bf40ce8f65f4dab4a475b0ce.zip | |
allow standalone execution of discover.py
Diffstat (limited to 'src')
| -rw-r--r-- | src/discover.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/discover.py b/src/discover.py index d0d13fe..1632af6 100644 --- a/src/discover.py +++ b/src/discover.py @@ -6,4 +6,11 @@ async def discover(): devices = await BleakScanner.discover() return [{"name": device.name, "address": device.address} for device in devices] except Exception: - return []
\ No newline at end of file + return [] + +async def main(): + devices = await discover() + print(devices) + +if __name__ == "__main__": + asyncio.run(main())
\ No newline at end of file |
