Full rearchitecture using Claude
- event bus systen - all components are independent - preparation for web frontend
This commit is contained in:
21
python-backend/musicmouse/devices/transport.py
Normal file
21
python-backend/musicmouse/devices/transport.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""The seam between :class:`~musicmouse.devices.mouse.MusicMouseDevice` and the wire.
|
||||
|
||||
Kept free of any serial import so the simulator can substitute a transport without
|
||||
pulling in ``pyserial-asyncio``.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Protocol
|
||||
|
||||
__all__ = ["Transport"]
|
||||
|
||||
|
||||
class Transport(Protocol):
|
||||
def write(self, data: bytes) -> None:
|
||||
"""Send bytes to the firmware. Dropping them while disconnected is fine:
|
||||
the device re-applies its memorized state once the link is back."""
|
||||
...
|
||||
|
||||
@property
|
||||
def connected(self) -> bool: ...
|
||||
Reference in New Issue
Block a user