Home Assistant Unofficial Reference 2024.12.1
diagnostics.py
Go to the documentation of this file.
1 """Diagnostics support for Google Assistant SDK."""
2 
3 from __future__ import annotations
4 
5 from typing import Any
6 
7 from homeassistant.components.diagnostics import async_redact_data
8 from homeassistant.config_entries import ConfigEntry
9 from homeassistant.core import HomeAssistant
10 
11 TO_REDACT = {"access_token", "refresh_token"}
12 
13 
15  hass: HomeAssistant, entry: ConfigEntry
16 ) -> dict[str, Any]:
17  """Return diagnostics for a config entry."""
18  return async_redact_data(
19  {
20  "data": entry.data,
21  "options": entry.options,
22  },
23  TO_REDACT,
24  )
dict async_redact_data(Mapping data, Iterable[Any] to_redact)
Definition: util.py:14
dict[str, Any] async_get_config_entry_diagnostics(HomeAssistant hass, ConfigEntry entry)
Definition: diagnostics.py:16