Support multi-display screen selection
All checks were successful
python-syntax / syntax-check (push) Successful in 1m33s
All checks were successful
python-syntax / syntax-check (push) Successful in 1m33s
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user