mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Cleanup coroutine threadsafe (#27080)
* Cleanup coroutine threadsafe * fix lint * Fix typing * Fix tests * Fix black
This commit is contained in:
@@ -10,7 +10,6 @@ from homeassistant import requirements, core, loader, config as conf_util
|
||||
from homeassistant.config import async_notify_setup_error
|
||||
from homeassistant.const import EVENT_COMPONENT_LOADED, PLATFORM_FORMAT
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.util.async_ import run_coroutine_threadsafe
|
||||
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -25,7 +24,7 @@ SLOW_SETUP_WARNING = 10
|
||||
|
||||
def setup_component(hass: core.HomeAssistant, domain: str, config: Dict) -> bool:
|
||||
"""Set up a component and all its dependencies."""
|
||||
return run_coroutine_threadsafe( # type: ignore
|
||||
return asyncio.run_coroutine_threadsafe(
|
||||
async_setup_component(hass, domain, config), hass.loop
|
||||
).result()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user