Add diagnostics platform to pyLoad integration (#120535)
This commit is contained in:
parent
44aad2b821
commit
42d235ce4d
3 changed files with 71 additions and 0 deletions
26
homeassistant/components/pyload/diagnostics.py
Normal file
26
homeassistant/components/pyload/diagnostics.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
"""Diagnostics support for pyLoad."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.components.diagnostics import async_redact_data
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from . import PyLoadConfigEntry
|
||||
from .coordinator import pyLoadData
|
||||
|
||||
TO_REDACT = {CONF_USERNAME, CONF_PASSWORD}
|
||||
|
||||
|
||||
async def async_get_config_entry_diagnostics(
|
||||
hass: HomeAssistant, config_entry: PyLoadConfigEntry
|
||||
) -> dict[str, Any]:
|
||||
"""Return diagnostics for a config entry."""
|
||||
pyload_data: pyLoadData = config_entry.runtime_data.data
|
||||
|
||||
return {
|
||||
"config_entry_data": async_redact_data(dict(config_entry.data), TO_REDACT),
|
||||
"pyload_data": pyload_data,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue