init commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
"""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."""
|
||||
Reference in New Issue
Block a user