1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 20:35:55 +00:00

Add support for home-assistant bootup (#349)

* Add support for home-assistant bootup

* fix bug

* fix

* fix ip bug

* bugfix
This commit is contained in:
Pascal Vizeli
2018-02-09 01:27:45 +01:00
committed by GitHub
parent b50756785e
commit dec04386bf
12 changed files with 101 additions and 52 deletions

View File

@@ -581,12 +581,12 @@ class Addon(CoreSysAttributes):
return STATE_STOPPED
@check_installed
def start(self):
"""Set options and start addon.
async def start(self):
"""Set options and start addon."""
if not self.write_options():
return False
Return a coroutine.
"""
return self.instance.run()
return await self.instance.run()
@check_installed
def stop(self):
@@ -611,16 +611,14 @@ class Addon(CoreSysAttributes):
# restore state
if last_state == STATE_STARTED:
await self.instance.run()
await self.start()
return True
@check_installed
def restart(self):
"""Restart addon.
Return a coroutine.
"""
return self.instance.restart()
async def restart(self):
"""Restart addon."""
await self.stop()
return await self.start()
@check_installed
def logs(self):
@@ -656,7 +654,7 @@ class Addon(CoreSysAttributes):
# restore state
if last_state == STATE_STARTED:
await self.instance.run()
await self.start()
return True
@check_installed