aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-10-06 10:14:14 +1300
committerArslaan Pathan <[email protected]>2026-10-06 10:14:14 +1300
commit7033b06aa0abaa4d07dac1ea465d6f1ec25dfa43 (patch)
tree8a8ed8e5302fbc9c8b9a1fa453e49997e0167e1f /main.py
parentf6d19bb8476a781f922149c3a990a0feaf26f655 (diff)
downloadremote-automation-7033b06aa0abaa4d07dac1ea465d6f1ec25dfa43.tar.xz
remote-automation-7033b06aa0abaa4d07dac1ea465d6f1ec25dfa43.zip
music controls better
Diffstat (limited to 'main.py')
-rw-r--r--main.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/main.py b/main.py
index 0a201b9..33d92f1 100644
--- a/main.py
+++ b/main.py
@@ -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-", 0x101: "app", 0x154: "1"}
+SCANCODES = {0x11A: "up", 0x148: "down", 0x147: "left", 0x107: "right", 0x106: "ok", 0x141: "play/pause", 0x11c: "power", 0x103: "vol+", 0x142: "vol-", 0x101: "app", 0x154: "1", 0x110: "stop", 0x14b: "skip"}
device = None
last = 0x00
@@ -29,6 +29,10 @@ def do_action(action: str):
homelab_request("music")
elif action == "1":
homelab_request("print_queue")
+ elif action == "stop":
+ homelab_request("music/stop")
+ elif action == "skip":
+ homelab_request("music/next")
for path in list_devices():
candidate = InputDevice(path)