Enable basic type checking for trace (#52468)
This commit is contained in:
parent
b3b377ac8b
commit
14dd6478d1
3 changed files with 3 additions and 7 deletions
|
@ -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()
|
||||||
|
|
||||||
|
|
3
mypy.ini
3
mypy.ini
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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.*",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue