feat(api): tcp driver registry, identify, preset push delivery

- Track Wi-Fi TCP clients, liveness pings, disconnect broadcast, bind errors via gather\n- Device list/get include connected; POST identify with __identify preset\n- Presets push/send delivery helpers; bump led-driver hello type

Made-with: Cursor
This commit is contained in:
pi
2026-04-06 00:21:57 +12:00
parent e6b5bf2cf1
commit f8eba0ee7e
15 changed files with 1052 additions and 108 deletions

View File

@@ -102,6 +102,7 @@ def test_upsert_wifi_tcp_client():
assert i1 == m1
d = devices.read(i1)
assert d["name"] == "kitchen"
assert d["type"] == "led"
assert d["transport"] == "wifi"
assert d["address"] == "192.168.1.20"
@@ -115,6 +116,14 @@ def test_upsert_wifi_tcp_client():
assert again == m1
assert devices.read(m1)["address"] == "192.168.1.99"
assert (
devices.upsert_wifi_tcp_client(
"kitchen", "192.168.1.100", m1, device_type="bogus"
)
== m1
)
assert devices.read(m1)["type"] == "led"
i3 = devices.upsert_wifi_tcp_client("hall", "10.0.0.5", "deadbeefcafe")
assert i3 == "deadbeefcafe"
assert len(devices.list()) == 3