Enable basic type checking for trace (#52468)

This commit is contained in:
Erik Montnemery 2021-07-03 17:52:31 +02:00 committed by GitHub
parent b3b377ac8b
commit 14dd6478d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 7 deletions

View File

@ -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()

View File

@ -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

View File

@ -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.*",