1
0
This commit is contained in:
Aiden
2026-05-27 21:37:50 +10:00
parent 21f0e455ee
commit 4364d0ed48
54 changed files with 30241 additions and 191 deletions

25
ccu_emulator/modules.py Normal file
View 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."""