run using asyncio
This commit is contained in:
parent
668d623dff
commit
949f6c235d
1 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
import pprint
|
import pprint
|
||||||
import signal
|
import signal
|
||||||
|
@ -29,7 +30,7 @@ def get_bridge(accessory_driver: AccessoryDriver, settings: Settings):
|
||||||
return bridge
|
return bridge
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
async def main():
|
||||||
logging.basicConfig(level="INFO")
|
logging.basicConfig(level="INFO")
|
||||||
settings = Settings()
|
settings = Settings()
|
||||||
logging.info("Running with settings:")
|
logging.info("Running with settings:")
|
||||||
|
@ -45,3 +46,7 @@ if __name__ == "__main__":
|
||||||
signal.signal(signal.SIGTERM, driver.signal_handler)
|
signal.signal(signal.SIGTERM, driver.signal_handler)
|
||||||
signal.signal(signal.SIGINT, driver.signal_handler)
|
signal.signal(signal.SIGINT, driver.signal_handler)
|
||||||
driver.start()
|
driver.start()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
asyncio.run(main())
|
||||||
|
|
Loading…
Reference in a new issue