diff --git a/homeassistant/components/device_tracker/__init__.py b/homeassistant/components/device_tracker/__init__.py index 346459e324e..d453c101a52 100644 --- a/homeassistant/components/device_tracker/__init__.py +++ b/homeassistant/components/device_tracker/__init__.py @@ -69,7 +69,15 @@ def is_on(hass: HomeAssistant, entity_id: str) -> bool: async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the device tracker.""" - await async_setup_legacy_integration(hass, config) + # + # Legacy and platforms load in a non-awaited tracked task + # to ensure device tracker setup can continue and config + # entry integrations are not waiting for legacy device + # tracker platforms to be set up. + # + hass.async_create_task( + async_setup_legacy_integration(hass, config), eager_start=True + ) return True diff --git a/homeassistant/components/device_tracker/legacy.py b/homeassistant/components/device_tracker/legacy.py index 0f0d842c595..c3aec89be90 100644 --- a/homeassistant/components/device_tracker/legacy.py +++ b/homeassistant/components/device_tracker/legacy.py @@ -217,21 +217,6 @@ async def async_setup_integration(hass: HomeAssistant, config: ConfigType) -> No DOMAIN, SERVICE_SEE, async_see_service, SERVICE_SEE_PAYLOAD_SCHEMA ) - # - # The platforms load in a non-awaited tracked task - # to ensure device tracker setup can continue and config - # entry integrations are not waiting for legacy device - # tracker platforms to be set up. - # - hass.async_create_task( - _async_setup_legacy_integration(hass, config, tracker), eager_start=True - ) - - -async def _async_setup_legacy_integration( - hass: HomeAssistant, config: ConfigType, tracker: DeviceTracker -) -> None: - """Set up the legacy integration.""" legacy_platforms = await async_extract_config(hass, config) setup_tasks = [