From d164039bba5fd901658a8210dbff60fef20a8e04 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 28 Feb 2024 05:55:41 -1000 Subject: [PATCH] Remove gather for loading generated files in zeroconf (#111699) async_get_custom_components is the only place this can suspend and it will always be cached by the time this is called so there is no reason to schedule these on the event loop --- homeassistant/components/zeroconf/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/zeroconf/__init__.py b/homeassistant/components/zeroconf/__init__.py index 2e058c4067c..344c174242a 100644 --- a/homeassistant/components/zeroconf/__init__.py +++ b/homeassistant/components/zeroconf/__init__.py @@ -1,7 +1,6 @@ """Support for exposing Home Assistant via Zeroconf.""" from __future__ import annotations -import asyncio import contextlib from contextlib import suppress from dataclasses import dataclass @@ -215,9 +214,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: aio_zc = await _async_get_instance(hass, **zc_args) zeroconf = cast(HaZeroconf, aio_zc.zeroconf) - zeroconf_types, homekit_models = await asyncio.gather( - async_get_zeroconf(hass), async_get_homekit(hass) - ) + zeroconf_types = await async_get_zeroconf(hass) + homekit_models = await async_get_homekit(hass) homekit_model_lookup, homekit_model_matchers = _build_homekit_model_lookups( homekit_models )