homelab-codex-ws/services/ha-diag-agent/src/ha_diag/checks/base.py

19 lines
458 B
Python
Raw Normal View History

from __future__ import annotations
from abc import ABC, abstractmethod
from ..models import CheckResult
class Check(ABC):
"""Base class for all HA diagnostic checks."""
name: str # unique slug used in /trigger/<name> and check_history
@abstractmethod
async def run(self) -> CheckResult:
"""Execute the check and return a result.
The caller is responsible for emitting events when result.event_type is set.
"""