aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend.py9
-rw-r--r--main.py4
2 files changed, 13 insertions, 0 deletions
diff --git a/backend.py b/backend.py
index 2b9ed9a..405bdae 100644
--- a/backend.py
+++ b/backend.py
@@ -130,5 +130,14 @@ def music_stop():
return {"status": "not_playing"}
[email protected]("/automate/volup")
+def volup():
+ os.system("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+")
+
+
[email protected]("/automate/voldown")
+def voldown():
+ os.system("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-")
+
if __name__ == "__main__":
app.run(host="0.0.0.0", port=6732)
diff --git a/main.py b/main.py
index 33d92f1..17530a4 100644
--- a/main.py
+++ b/main.py
@@ -33,6 +33,10 @@ def do_action(action: str):
homelab_request("music/stop")
elif action == "skip":
homelab_request("music/next")
+ elif action == "vol+":
+ homelab_request("volup")
+ elif action == "vol-":
+ homelab_request("voldown")
for path in list_devices():
candidate = InputDevice(path)