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,35 @@
#!/usr/bin/env python3
"""Tests for pushing group membership to all ESP-NOW devices."""
import asyncio
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / "src"))
def test_push_groups_all_espnow_devices(monkeypatch):
from util import espnow_registry
class _Devices:
def items(self):
return [
("aabbccddeeff", {"transport": "espnow"}),
("wifi-1", {"transport": "wifi", "address": "192.168.1.1"}),
]
pushed = []
async def fake_push(mac):
pushed.append(mac)
return True
monkeypatch.setattr(espnow_registry, "Device", _Devices)
monkeypatch.setattr(espnow_registry, "push_groups_to_mac", fake_push)
result = asyncio.run(espnow_registry.push_groups_all_espnow_devices())
assert result["ok"] is True
assert result["sent"] == 1
assert result["total"] == 1
assert pushed == ["aabbccddeeff"]