Code review

This commit is contained in:
Aaron Bach
2022-01-28 22:25:19 -07:00
parent 74c9ed7450
commit 0a1deffe97

View File

@@ -3,15 +3,17 @@ from __future__ import annotations
from collections.abc import Iterable, Mapping from collections.abc import Iterable, Mapping
from copy import deepcopy from copy import deepcopy
from typing import Any from typing import Any, TypeVar
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: Mapping, to_redact: Iterable[Any]) -> Mapping[Any, Any]: def async_redact_data(data: T, to_redact: Iterable[Any]) -> T:
"""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