updates
This commit is contained in:
25
ccu_emulator/modules.py
Normal file
25
ccu_emulator/modules.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import Protocol
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ModuleTx:
|
||||
frame: bytes
|
||||
label: str
|
||||
delay: float = 0.0
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ModuleDecision:
|
||||
tx: tuple[ModuleTx, ...] = ()
|
||||
suppress_default_ack: bool = False
|
||||
reason: str = ""
|
||||
|
||||
|
||||
class CcuModule(Protocol):
|
||||
name: str
|
||||
|
||||
def on_rx(self, frame: bytes, label: str = "") -> ModuleDecision | None:
|
||||
"""Inspect an RCP frame and optionally provide CCU response frames."""
|
||||
Reference in New Issue
Block a user