Initial commit: Main Gate Controller HACS integration
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
"""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,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user