From 949f6c235d942b96c12c2219394008dd602ede48 Mon Sep 17 00:00:00 2001 From: dnutiu Date: Wed, 7 Feb 2024 21:49:46 +0200 Subject: [PATCH] run using asyncio --- app/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 8baef8f..8d337e0 100644 --- a/app/main.py +++ b/app/main.py @@ -1,3 +1,4 @@ +import asyncio import logging import pprint import signal @@ -29,7 +30,7 @@ def get_bridge(accessory_driver: AccessoryDriver, settings: Settings): return bridge -if __name__ == "__main__": +async def main(): logging.basicConfig(level="INFO") settings = Settings() logging.info("Running with settings:") @@ -45,3 +46,7 @@ if __name__ == "__main__": signal.signal(signal.SIGTERM, driver.signal_handler) signal.signal(signal.SIGINT, driver.signal_handler) driver.start() + + +if __name__ == "__main__": + asyncio.run(main())