Files
radar_system/python_app/hardware_full/switch_drivers/interface.py
T
2026-10-06 12:32:26 +03:00

28 lines
690 B
Python

"""Protocols for switch backend implementations."""
from __future__ import annotations
from typing import Protocol
class SwitchDriverProtocol(Protocol):
"""Required contract for all switch backends."""
def open(self) -> None:
"""Open hardware or mock resources."""
def close(self) -> None:
"""Close hardware or mock resources."""
def position_count(self) -> int:
"""Return total number of supported positions."""
...
def switch_to(self, position: int) -> None:
"""Switch to requested zero-based position."""
@property
def current_position(self) -> int:
"""Return currently active position."""
...