feat(bridge): add wifi/serial bridge runtime and UI

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-28 00:38:21 +12:00
parent 2cf019079e
commit 78dc8ffc77
92 changed files with 5679 additions and 1790 deletions

View File

@@ -0,0 +1,40 @@
#!/usr/bin/env python3
"""Tests for bridge serial connect profile handling."""
from __future__ import annotations
import asyncio
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "src"))
def test_connect_bridge_profile_serial(monkeypatch):
from util import bridge_runtime
calls = {}
async def fake_connect_serial(profile, settings):
calls["profile"] = profile
calls["settings"] = settings
return True, ""
monkeypatch.setattr(bridge_runtime, "connect_bridge_serial", fake_connect_serial)
class _Settings(dict):
def save(self):
pass
settings = _Settings({"bridge_serial_port": ""})
profile = {
"transport": "serial",
"serial_port": "/dev/ttyUSB0",
"serial_baudrate": 921600,
}
ok, err = asyncio.run(bridge_runtime.connect_bridge_profile(profile, settings))
assert ok is True
assert err == ""
assert calls["profile"]["serial_port"] == "/dev/ttyUSB0"