This commit is contained in:
Logan
2026-04-06 00:23:33 -04:00
parent 1a9c92b6db
commit 7de55f9885
10 changed files with 189 additions and 44 deletions
+11 -2
View File
@@ -53,9 +53,18 @@ class OP25Client:
"""Poll the OP25 HTTP terminal for current call metadata."""
try:
async with httpx.AsyncClient(timeout=3) as client:
r = await client.get(f"{self.terminal_url}/0/status.json")
r = await client.post(
self.terminal_url,
json=[{"command": "update", "arg1": 0, "arg2": 0}],
)
r.raise_for_status()
return r.json()
messages = r.json()
for msg in messages:
if msg.get("json_type") == "channel_update":
channels = msg.get("channels", [])
if channels:
return msg.get(str(channels[0]), {})
return None
except Exception:
return None