added Georg class and implemented functioning pause/play button
This commit is contained in:
15
Grzegorz.py
Normal file
15
Grzegorz.py
Normal 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()}")
|
||||
Reference in New Issue
Block a user