diff options
| author | Arslaan Pathan <[email protected]> | 2026-10-05 23:57:30 +1300 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-10-05 23:57:30 +1300 |
| commit | 7cdcb33651ea07f3522d78d3cb29c8b1ecec6bf9 (patch) | |
| tree | 77876208bbfe978f5f269cea97410d85497a6488 | |
| parent | 9640a806a36095c7539b66feb0869f99ef559017 (diff) | |
| download | remote-automation-7cdcb33651ea07f3522d78d3cb29c8b1ecec6bf9.tar.xz remote-automation-7cdcb33651ea07f3522d78d3cb29c8b1ecec6bf9.zip | |
more actions
| -rw-r--r-- | main.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -2,7 +2,7 @@ from evdev import InputDevice, list_devices, ecodes from urllib.request import urlopen from urllib.error import HTTPError, URLError -SCANCODES = {0x11A: "up", 0x148: "down", 0x147: "left", 0x107: "right", 0x106: "ok", 0x141: "play/pause", 0x11c: "power", 0x103: "vol+", 0x142: "vol-"} +SCANCODES = {0x11A: "up", 0x148: "down", 0x147: "left", 0x107: "right", 0x106: "ok", 0x141: "play/pause", 0x11c: "power", 0x103: "vol+", 0x142: "vol-", 0x101: "app"} device = None last = 0x00 @@ -23,8 +23,10 @@ def homelab_request(request: str): print(f"homelab request failed: {e.reason}") def do_action(action: str): - if action == "ok": - homelab_request("hack_this_club") # /j + if action == "app": + homelab_request("hack_this_club") # /j (test endpoint) + elif action == "play/pause": + homelab_request("music") for path in list_devices(): candidate = InputDevice(path) |
