@@ -1 +1,2 @@
.venv/
+__pycache__/
@@ -2,11 +2,15 @@ import time
from mpd import MPDClient
+time.sleep(10)
client = MPDClient()
client.timeout = 60
client.connect("localhost", 6600)
client.clear()
+client.setvol(50)
+client.repeat(1)
+client.single(1)
+
client.load("internetradio")
-client.setvol(60)
client.play(0)
@@ -0,0 +1,11 @@
+[Unit]
+Description=Internet Radio
+[Service]
+Restart=always
+User=robert
+WorkingDirectory=/home/robert/radio
+ExecStart=/bin/bash -c "source /home/robert/radio/.venv/bin/activate && sleep 20 && python3 /home/robert/radio/main.py"
+[Install]
+WantedBy=multi-user.target