mirror of
https://github.com/home-assistant/core.git
synced 2026-05-30 04:05:01 +01:00
d766aae436
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: frenck <195327+frenck@users.noreply.github.com>
44 lines
1.0 KiB
Python
44 lines
1.0 KiB
Python
"""Diagnostics support for WattTime."""
|
|
|
|
from typing import Any
|
|
|
|
from homeassistant.components.diagnostics import async_redact_data
|
|
from homeassistant.const import (
|
|
CONF_LATITUDE,
|
|
CONF_LONGITUDE,
|
|
CONF_PASSWORD,
|
|
CONF_UNIQUE_ID,
|
|
CONF_USERNAME,
|
|
)
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .const import CONF_BALANCING_AUTHORITY, CONF_BALANCING_AUTHORITY_ABBREV
|
|
from .coordinator import WattTimeConfigEntry
|
|
|
|
CONF_TITLE = "title"
|
|
|
|
TO_REDACT = {
|
|
CONF_BALANCING_AUTHORITY,
|
|
CONF_BALANCING_AUTHORITY_ABBREV,
|
|
CONF_LATITUDE,
|
|
CONF_LONGITUDE,
|
|
CONF_PASSWORD,
|
|
# Config entry title and unique ID may contain sensitive data:
|
|
CONF_TITLE,
|
|
CONF_UNIQUE_ID,
|
|
CONF_USERNAME,
|
|
}
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
|
hass: HomeAssistant, entry: WattTimeConfigEntry
|
|
) -> dict[str, Any]:
|
|
"""Return diagnostics for a config entry."""
|
|
return async_redact_data(
|
|
{
|
|
"entry": entry.as_dict(),
|
|
"data": entry.runtime_data.data,
|
|
},
|
|
TO_REDACT,
|
|
)
|