mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
32 lines
799 B
Python
32 lines
799 B
Python
"""Diagnostics support for Gatus."""
|
|
|
|
from typing import Any
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
from .coordinator import GatusConfigEntry
|
|
|
|
|
|
async def async_get_config_entry_diagnostics(
|
|
hass: HomeAssistant, entry: GatusConfigEntry
|
|
) -> dict[str, Any]:
|
|
"""Return diagnostics for a config entry."""
|
|
coordinator = entry.runtime_data
|
|
return {
|
|
"data": [
|
|
{
|
|
"key": ep.key,
|
|
"name": ep.name,
|
|
"group": ep.group,
|
|
"results": [
|
|
{
|
|
"success": r.success,
|
|
"status": r.status,
|
|
}
|
|
for r in ep.results
|
|
],
|
|
}
|
|
for ep in coordinator.data.values()
|
|
],
|
|
}
|