Home Assistant Unofficial Reference 2024.12.1
diagnostics.py
Go to the documentation of this file.
1 """Diagnostics support for BraviaTV."""
2 
3 from typing import Any
4 
5 from homeassistant.components.diagnostics import async_redact_data
6 from homeassistant.const import CONF_MAC, CONF_PIN
7 from homeassistant.core import HomeAssistant
8 
9 from . import BraviaTVConfigEntry
10 
11 TO_REDACT = {CONF_MAC, CONF_PIN, "macAddr"}
12 
13 
15  hass: HomeAssistant, config_entry: BraviaTVConfigEntry
16 ) -> dict[str, Any]:
17  """Return diagnostics for a config entry."""
18  coordinator = config_entry.runtime_data
19 
20  device_info = await coordinator.client.get_system_info()
21 
22  return {
23  "config_entry": async_redact_data(config_entry.as_dict(), TO_REDACT),
24  "device_info": async_redact_data(device_info, TO_REDACT),
25  }
dict[str, Any] async_get_config_entry_diagnostics(HomeAssistant hass, BraviaTVConfigEntry config_entry)
Definition: diagnostics.py:16
dict async_redact_data(Mapping data, Iterable[Any] to_redact)
Definition: util.py:14