Files
lan_checker/checkers/base.py
Antoine Van Elstraete 02b14979bc Initial commit: LAN Checker
Network health monitoring script with MQTT reporting for Home Assistant.
- Ping, HTTP, and SNMP checkers
- MQTT Discovery for automatic entity creation
- Configurable check intervals

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 16:22:55 +01:00

22 lines
440 B
Python

from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Any
@dataclass
class CheckResult:
success: bool
message: str
response_time: float | None = None
details: dict[str, Any] | None = None
class BaseChecker(ABC):
def __init__(self, name: str, config: dict):
self.name = name
self.config = config
@abstractmethod
def check(self) -> CheckResult:
pass