Skip to content

Commit

Permalink
Make common setup async.
Browse files Browse the repository at this point in the history
Fixes #1415
  • Loading branch information
ludeeus committed Jul 31, 2020
1 parent 8aded43 commit 9541271
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/hacs/operational/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from custom_components.hacs.share import get_hacs


def _common_setup(hass):
async def _async_common_setup(hass):
"""Common setup stages."""
hacs = get_hacs()
hacs.hass = hass
Expand All @@ -50,7 +50,7 @@ async def async_setup_entry(hass, config_entry):
hass.async_create_task(hass.config_entries.async_remove(config_entry.entry_id))
return False

await hass.async_add_executor_job(_common_setup, hass)
await _async_common_setup(hass)

hacs.configuration = Configuration.from_dict(
config_entry.data, config_entry.options
Expand All @@ -69,7 +69,7 @@ async def async_setup(hass, config):
if hacs.configuration and hacs.configuration.config_type == "flow":
return True

await hass.async_add_executor_job(_common_setup, hass)
await _async_common_setup(hass)

hass.data[DOMAIN] = config[DOMAIN]
hacs.configuration = Configuration.from_dict(config[DOMAIN])
Expand Down

0 comments on commit 9541271

Please sign in to comment.