28 lines
737 B
Python
28 lines
737 B
Python
"""Diagnostics for SolarEdge Optimizers."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import asdict
|
|
from typing import Any
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from . import SolarEdgeOptimizerConfigEntry
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
|
hass: HomeAssistant, entry: SolarEdgeOptimizerConfigEntry
|
|
) -> dict[str, Any]:
|
|
"""Return diagnostics for a config entry."""
|
|
return {
|
|
"entry": {
|
|
"title": entry.title,
|
|
"unique_id": entry.unique_id,
|
|
"data": dict(entry.data),
|
|
},
|
|
"coordinator": {
|
|
"last_update_success": entry.runtime_data.last_update_success,
|
|
"snapshot": asdict(entry.runtime_data.data),
|
|
},
|
|
}
|