Support multi-display screen selection
All checks were successful
python-syntax / syntax-check (push) Successful in 1m33s

This commit is contained in:
Space-Banane
2026-04-29 21:52:01 +02:00
parent a8f2e01bb9
commit 775c188732
6 changed files with 170 additions and 33 deletions

View File

@@ -5,6 +5,7 @@ import requests
BASE_URL = os.getenv("CLICKTHROUGH_URL", "http://127.0.0.1:8123")
TOKEN = os.getenv("CLICKTHROUGH_TOKEN", "")
SCREEN = int(os.getenv("CLICKTHROUGH_SCREEN", "0"))
headers = {}
if TOKEN:
@@ -16,10 +17,14 @@ def main():
r.raise_for_status()
print("health:", r.json())
d = requests.get(f"{BASE_URL}/displays", headers=headers, timeout=10)
d.raise_for_status()
print("displays:", d.json().get("displays", []))
s = requests.get(
f"{BASE_URL}/screen",
headers=headers,
params={"with_grid": True, "grid_rows": 12, "grid_cols": 12},
params={"screen": SCREEN, "with_grid": True, "grid_rows": 12, "grid_cols": 12},
timeout=30,
)
s.raise_for_status()