Return a error on update with own version (#124)

Return a error on update with own version
This commit is contained in:
Pascal Vizeli
2017-08-02 16:59:38 +02:00
committed by GitHub
parent 3809f20c6a
commit 8afde1e881
7 changed files with 92 additions and 51 deletions

View File

@@ -113,13 +113,15 @@ class HomeAssistant(JsonConfig):
_LOGGER.info("HomeAssistant docker now installed")
await self.docker.cleanup()
def update(self, version=None):
"""Update HomeAssistant version.
Return a coroutine.
"""
async def update(self, version=None):
"""Update HomeAssistant version."""
version = version or self.last_version
return self.docker.update(version)
if version == self.docker.version:
_LOGGER.warning("Version %s is already installed", version)
return False
return await self.docker.update(version)
def run(self):
"""Run HomeAssistant docker.