Home Assistant Unofficial Reference 2024.12.1
diagnostics.py
Go to the documentation of this file.
1 """Diagnostics support for SamsungTV."""
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.const import CONF_TOKEN
9 from homeassistant.core import HomeAssistant
10 
11 from . import SamsungTVConfigEntry
12 from .const import CONF_SESSION_ID
13 
14 TO_REDACT = {CONF_TOKEN, CONF_SESSION_ID}
15 
16 
18  hass: HomeAssistant, entry: SamsungTVConfigEntry
19 ) -> dict[str, Any]:
20  """Return diagnostics for a config entry."""
21  coordinator = entry.runtime_data
22  return {
23  "entry": async_redact_data(entry.as_dict(), TO_REDACT),
24  "device_info": await coordinator.bridge.async_device_info(),
25  }
dict async_redact_data(Mapping data, Iterable[Any] to_redact)
Definition: util.py:14
dict[str, Any] async_get_config_entry_diagnostics(HomeAssistant hass, SamsungTVConfigEntry entry)
Definition: diagnostics.py:19