mirror of
https://github.com/home-assistant/core.git
synced 2026-07-02 20:26:16 +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>
23 lines
680 B
Python
23 lines
680 B
Python
"""Diagnostics support for Litter-Robot."""
|
|
|
|
from typing import Any
|
|
|
|
from pylitterbot.utils import REDACT_FIELDS
|
|
|
|
from homeassistant.components.diagnostics import async_redact_data
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .coordinator import LitterRobotConfigEntry
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
|
hass: HomeAssistant, entry: LitterRobotConfigEntry
|
|
) -> dict[str, Any]:
|
|
"""Return diagnostics for a config entry."""
|
|
account = entry.runtime_data.account
|
|
data = {
|
|
"robots": [robot.to_dict() for robot in account.robots],
|
|
"pets": [pet.to_dict() for pet in account.pets],
|
|
}
|
|
return async_redact_data(data, REDACT_FIELDS)
|