mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Enable basic type checking for trace (#52468)
This commit is contained in:
parent
b3b377ac8b
commit
14dd6478d1
@ -92,7 +92,7 @@ trace_path_stack_cv: ContextVar[list[str] | None] = ContextVar(
|
||||
# Copy of last variables
|
||||
variables_cv: ContextVar[Any | None] = ContextVar("variables_cv", default=None)
|
||||
# (domain, item_id) + Run ID
|
||||
trace_id_cv: ContextVar[tuple[str, str] | None] = ContextVar(
|
||||
trace_id_cv: ContextVar[tuple[tuple[str, str], str] | None] = ContextVar(
|
||||
"trace_id_cv", default=None
|
||||
)
|
||||
# Reason for stopped script execution
|
||||
@ -101,12 +101,12 @@ script_execution_cv: ContextVar[StopReason | None] = ContextVar(
|
||||
)
|
||||
|
||||
|
||||
def trace_id_set(trace_id: tuple[str, str]) -> None:
|
||||
def trace_id_set(trace_id: tuple[tuple[str, str], str]) -> None:
|
||||
"""Set id of the current trace."""
|
||||
trace_id_cv.set(trace_id)
|
||||
|
||||
|
||||
def trace_id_get() -> tuple[str, str] | None:
|
||||
def trace_id_get() -> tuple[tuple[str, str], str] | None:
|
||||
"""Get id if the current trace."""
|
||||
return trace_id_cv.get()
|
||||
|
||||
|
3
mypy.ini
3
mypy.ini
@ -1568,9 +1568,6 @@ ignore_errors = true
|
||||
[mypy-homeassistant.components.tplink.*]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.trace.*]
|
||||
ignore_errors = true
|
||||
|
||||
[mypy-homeassistant.components.tradfri.*]
|
||||
ignore_errors = true
|
||||
|
||||
|
@ -203,7 +203,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
||||
"homeassistant.components.todoist.*",
|
||||
"homeassistant.components.toon.*",
|
||||
"homeassistant.components.tplink.*",
|
||||
"homeassistant.components.trace.*",
|
||||
"homeassistant.components.tradfri.*",
|
||||
"homeassistant.components.tuya.*",
|
||||
"homeassistant.components.unifi.*",
|
||||
|
Loading…
x
Reference in New Issue
Block a user