diff --git a/custom_components/pixometer/__init__.py b/custom_components/pixometer/__init__.py index a7bc58b..e6cfac3 100644 --- a/custom_components/pixometer/__init__.py +++ b/custom_components/pixometer/__init__.py @@ -54,11 +54,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): @@ -78,9 +77,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) + return True