From 1d5a052df1d313c353db5b990bab53b0ce272574 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 30 Jan 2022 11:08:37 -0600 Subject: [PATCH] Fix debugpy blocking the event loop at startup (#65252) --- homeassistant/components/debugpy/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/debugpy/__init__.py b/homeassistant/components/debugpy/__init__.py index 21cfeb15a80..1dc0f525c4d 100644 --- a/homeassistant/components/debugpy/__init__.py +++ b/homeassistant/components/debugpy/__init__.py @@ -46,7 +46,9 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Enable asyncio debugging and start the debugger.""" get_running_loop().set_debug(True) - debugpy.listen((conf[CONF_HOST], conf[CONF_PORT])) + await hass.async_add_executor_job( + debugpy.listen, (conf[CONF_HOST], conf[CONF_PORT]) + ) if conf[CONF_WAIT]: _LOGGER.warning(