Files
mass-hacs-gate-button/custom_components/main_gate_controller/diagnostics.py
T
bot 988a30cbf7
Tests / pytest + ruff (3.12) (push) Has been cancelled
Validate / HACS validation (push) Has been cancelled
Validate / Hassfest validation (push) Has been cancelled
Initial commit: Main Gate Controller HACS integration
2026-09-07 23:19:12 +02:00

32 lines
993 B
Python

"""Diagnostics support for the Main Gate Controller integration."""
from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_get_config_for_diagnostics
from homeassistant.core import HomeAssistant
from . import MainGateConfigEntry
from .coordinator import MainGateController
async def async_get_diagnostics(
hass: HomeAssistant, entry: MainGateConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a single gate.
No secrets are stored in this integration — there is no host, username,
password or token — so the whole config entry and controller state can be
reported verbatim.
"""
controller: MainGateController = entry.runtime_data
return {
"config": await async_get_config_for_diagnostics(hass, entry),
"state": {
"status": controller.status,
"is_running": controller.is_running,
**controller.extra_state_attributes,
},
}