Home Assistant Unofficial Reference 2024.12.1
diagnostics.py
Go to the documentation of this file.
1 """Provides diagnostics for Advantage Air."""
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.core import HomeAssistant
9 
10 from . import AdvantageAirDataConfigEntry
11 
12 TO_REDACT = [
13  "dealerPhoneNumber",
14  "latitude",
15  "logoPIN",
16  "longitude",
17  "postCode",
18  "rid",
19  "deviceNames",
20  "deviceIds",
21  "deviceIdsV2",
22  "backupId",
23 ]
24 
25 
27  hass: HomeAssistant, config_entry: AdvantageAirDataConfigEntry
28 ) -> dict[str, Any]:
29  """Return diagnostics for a config entry."""
30  data = config_entry.runtime_data.coordinator.data
31 
32  # Return only the relevant children
33  return {
34  "aircons": data.get("aircons"),
35  "myLights": data.get("myLights"),
36  "myThings": data.get("myThings"),
37  "system": async_redact_data(data["system"], TO_REDACT),
38  }
dict[str, Any] async_get_config_entry_diagnostics(HomeAssistant hass, AdvantageAirDataConfigEntry config_entry)
Definition: diagnostics.py:28
dict async_redact_data(Mapping data, Iterable[Any] to_redact)
Definition: util.py:14