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 # Copy of last variables
variables_cv: ContextVar[Any | None] = ContextVar("variables_cv", default=None) variables_cv: ContextVar[Any | None] = ContextVar("variables_cv", default=None)
# (domain, item_id) + Run ID # (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 "trace_id_cv", default=None
) )
# Reason for stopped script execution # 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.""" """Set id of the current trace."""
trace_id_cv.set(trace_id) 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.""" """Get id if the current trace."""
return trace_id_cv.get() return trace_id_cv.get()

View file

@ -1568,9 +1568,6 @@ ignore_errors = true
[mypy-homeassistant.components.tplink.*] [mypy-homeassistant.components.tplink.*]
ignore_errors = true ignore_errors = true
[mypy-homeassistant.components.trace.*]
ignore_errors = true
[mypy-homeassistant.components.tradfri.*] [mypy-homeassistant.components.tradfri.*]
ignore_errors = true ignore_errors = true

View file

@ -203,7 +203,6 @@ IGNORED_MODULES: Final[list[str]] = [
"homeassistant.components.todoist.*", "homeassistant.components.todoist.*",
"homeassistant.components.toon.*", "homeassistant.components.toon.*",
"homeassistant.components.tplink.*", "homeassistant.components.tplink.*",
"homeassistant.components.trace.*",
"homeassistant.components.tradfri.*", "homeassistant.components.tradfri.*",
"homeassistant.components.tuya.*", "homeassistant.components.tuya.*",
"homeassistant.components.unifi.*", "homeassistant.components.unifi.*",