Skip to content

Commit

Permalink
Fix some api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Aug 4, 2019
1 parent 2cb3026 commit 3792966
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion custom_components/hacs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ async def hacs_startup(hacs):
if not val.validate_local_data_file():
return False
else:
os.remove(f"{hacs.system.config_path}/.storage/hacs")
if os.path.exists(f"{hacs.system.config_path}/.storage/hacs"):
os.remove(f"{hacs.system.config_path}/.storage/hacs")

# Restore from storefiles
if not await hacs.data.restore():
Expand Down
3 changes: 2 additions & 1 deletion custom_components/hacs/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class RepositoriesReload(HacsAPI):

async def response(self):
"""Response."""
self.hass.async_create_task(self.load_known_repositories())
self.hass.async_create_task(self.recuring_tasks_all())
return web.HTTPFound(f"/hacsweb/{self.token}/settings?timestamp={time()}")


Expand All @@ -301,6 +301,7 @@ async def response(self):
for repository in self.repositories:
if repository.pending_upgrade:
await repository.install()
self.data.write()
return web.HTTPFound(f"/hacsweb/{self.token}/settings?timestamp={time()}")


Expand Down
4 changes: 2 additions & 2 deletions custom_components/hacs/hacsbase/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ async def startup_tasks(self):
self.system.status.background_task = False
self.data.write()

async def recuring_tasks_installed(self, notarealarg):
async def recuring_tasks_installed(self, notarealarg=None):
"""Recuring tasks for installed repositories."""
self.logger.debug(
"Starting recuring background task for installed repositories"
Expand All @@ -192,7 +192,7 @@ async def recuring_tasks_installed(self, notarealarg):
self.data.write()
self.logger.debug("Recuring background task for installed repositories done")

async def recuring_tasks_all(self, notarealarg):
async def recuring_tasks_all(self, notarealarg=None):
"""Recuring tasks for all repositories."""
self.logger.debug("Starting recuring background task for all repositories")
self.system.status.background_task = True
Expand Down

0 comments on commit 3792966

Please sign in to comment.