mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 21:55:10 +02:00
Typing
This commit is contained in:
@@ -2,17 +2,17 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Iterable, Mapping
|
from collections.abc import Iterable, Mapping
|
||||||
from typing import Any, TypeVar
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
|
|
||||||
from .const import REDACTED
|
from .const import REDACTED
|
||||||
|
|
||||||
T = TypeVar("T")
|
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_redact_data(data: T, to_redact: Iterable[Any]) -> T:
|
def async_redact_data(
|
||||||
|
data: list | dict[str, Any], to_redact: Iterable[Any]
|
||||||
|
) -> list | dict[str, Any]:
|
||||||
"""Redact sensitive data in a dict."""
|
"""Redact sensitive data in a dict."""
|
||||||
if not isinstance(data, (Mapping, list)):
|
if not isinstance(data, (Mapping, list)):
|
||||||
return data
|
return data
|
||||||
|
Reference in New Issue
Block a user