api: initialize ccujack asynchonously via immedietaly running cron
This commit is contained in:
parent
b752888812
commit
64ab73e9c3
1 changed files with 3 additions and 6 deletions
|
|
@ -90,15 +90,12 @@ class CCUJackClient:
|
|||
self.data_updated = asyncio.Event()
|
||||
|
||||
async def start(self):
|
||||
await self.mqtt.connect()
|
||||
await self.find_locks()
|
||||
|
||||
self.task_cron= asyncio.get_running_loop().create_task(
|
||||
self.cron(), name="ccujack-cron"
|
||||
)
|
||||
self.task_process_messages = asyncio.get_running_loop().create_task(
|
||||
self.process_mqt_messages(), name="process-mqtt-messages"
|
||||
)
|
||||
self.task_cron= asyncio.get_running_loop().create_task(
|
||||
self.cron(), name="ccujack-cron"
|
||||
)
|
||||
|
||||
async def close_connections(self):
|
||||
await asyncio.gather(self.mqtt.disconnect(), self.http.close())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue