added Georg class and implemented functioning pause/play button

This commit is contained in:
Thomaajo
2025-06-10 18:28:02 +02:00
parent c3905fb61b
commit 49a525c13f
6 changed files with 45 additions and 17 deletions

15
Grzegorz.py Normal file
View File

@@ -0,0 +1,15 @@
import requests as rq
class Georg:
def __init__(self):
self.url = "https://georg-backend.pvv.ntnu.no"
self.currentlyPlaying = self.getCurrentlyPlaying()
def getCurrentlyPlaying(self):
return rq.get(f"{self.url}/api/play").json()["value"]
def togglePlay(self):
return rq.post(f"{self.url}/play?play={not self.getCurrentlyPlaying()}")