mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-13 12:16:29 +00:00
split logic
This commit is contained in:
parent
b268331ad5
commit
483542d1e7
@ -18,6 +18,9 @@ if __name__ == "__main__":
|
||||
loop = asyncio.get_event_loop()
|
||||
hassio = core.HassIO(loop)
|
||||
|
||||
_LOGGER.info("Run Hassio setup")
|
||||
loop.run_until_complete(hassio.setup())
|
||||
|
||||
_LOGGER.info("Start Hassio task")
|
||||
loop.create_task(hassio.start())
|
||||
|
||||
|
@ -38,8 +38,8 @@ class HassIO(object):
|
||||
# init HostControll
|
||||
self.host_controll = HostControll(self.loop)
|
||||
|
||||
async def start(self):
|
||||
"""Start HassIO orchestration."""
|
||||
async def setup(self):
|
||||
"""Setup HassIO orchestration."""
|
||||
# supervisor
|
||||
await self.supervisor.attach()
|
||||
_LOGGER.info(
|
||||
@ -70,6 +70,8 @@ class HassIO(object):
|
||||
_LOGGER.info("No HomeAssistant docker found.")
|
||||
await self._setup_homeassistant()
|
||||
|
||||
async def start(self):
|
||||
"""Start HassIO orchestration."""
|
||||
# start api
|
||||
await self.api.start()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user