mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Enable asyncio debugging from debugpy integration (#51880)
* Optionally enable asyncio debugging from debugpy integration * Unconditionally enable asyncio debugging
This commit is contained in:
parent
3db8d9ede5
commit
f3c6e846fa
@ -1,7 +1,7 @@
|
||||
"""The Remote Python Debugger integration."""
|
||||
from __future__ import annotations
|
||||
|
||||
from asyncio import Event
|
||||
from asyncio import Event, get_event_loop
|
||||
import logging
|
||||
from threading import Thread
|
||||
|
||||
@ -15,8 +15,8 @@ from homeassistant.helpers.service import async_register_admin_service
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
|
||||
DOMAIN = "debugpy"
|
||||
CONF_WAIT = "wait"
|
||||
CONF_START = "start"
|
||||
CONF_WAIT = "wait"
|
||||
SERVICE_START = "start"
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema(
|
||||
@ -43,7 +43,9 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
async def debug_start(
|
||||
call: ServiceCall | None = None, *, wait: bool = True
|
||||
) -> None:
|
||||
"""Start the debugger."""
|
||||
"""Enable asyncio debugging and start the debugger."""
|
||||
get_event_loop().set_debug(True)
|
||||
|
||||
debugpy.listen((conf[CONF_HOST], conf[CONF_PORT]))
|
||||
|
||||
wait = conf[CONF_WAIT]
|
||||
|
Loading…
x
Reference in New Issue
Block a user