Skip to content

Commit

Permalink
fix await async setup
Browse files Browse the repository at this point in the history
  • Loading branch information
myTselection committed Jul 14, 2024
1 parent 6f973f5 commit 22327cc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions custom_components/myenergy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ async def async_setup(hass: HomeAssistant, config: dict):
except ValueError:
pass

hass.async_create_task(
await hass.config_entries.flow.async_init(
await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_IMPORT}, data={}
)
)

return True

async def async_update_options(hass: HomeAssistant, config_entry: ConfigEntry):
Expand All @@ -72,9 +71,8 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry):

async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Set up component as config entry."""
hass.async_create_task(
await hass.config_entries.async_forward_entry_setup(config_entry, Platform.SENSOR)
)
await hass.config_entries.async_forward_entry_setup(config_entry, Platform.SENSOR)

config_entry.async_on_unload(config_entry.add_update_listener(update_listener))
# _LOGGER.info(f"{DOMAIN} register_services")
# register_services(hass, config_entry)
Expand Down

0 comments on commit 22327cc

Please sign in to comment.