server almost running - Second display working
This commit is contained in:
@@ -6,7 +6,10 @@ class Com:
|
||||
pass
|
||||
|
||||
def connect(self, url):
|
||||
self.x = requests.get(f"{url}/tryconnect")
|
||||
try:
|
||||
self.x = requests.get(f"{url}/tryconnect")
|
||||
except Exception:
|
||||
return False
|
||||
print(self.x.text)
|
||||
if self.x.text == "ok":
|
||||
return True
|
||||
@@ -14,13 +17,40 @@ class Com:
|
||||
return False
|
||||
|
||||
def getcurrentsong(self, url):
|
||||
return "Testsong"
|
||||
try:
|
||||
self.x = requests.get(f"{url}/currentsong")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return "Error"
|
||||
return self.x.text
|
||||
|
||||
def getsonglength(self, url):
|
||||
return 100
|
||||
try:
|
||||
self.x = requests.get(f"{url}/songmaxlength")
|
||||
except Exception:
|
||||
return 100
|
||||
return int(self.x.text)
|
||||
|
||||
def getupcomingsongs(self, url):
|
||||
return "Test1\nTest2"
|
||||
try:
|
||||
self.x = requests.get(f"{url}/upcomingsongs")
|
||||
except Exception:
|
||||
return "Error"
|
||||
return self.x.text
|
||||
|
||||
def getsongpos(self, url):
|
||||
return 2
|
||||
try:
|
||||
self.x = requests.get(f"{url}/playbackpos")
|
||||
except Exception:
|
||||
return 0
|
||||
return int(self.x.text)
|
||||
|
||||
def checkiffullscreen(self, url):
|
||||
try:
|
||||
self.x = requests.get(f"{url}/currentsong")
|
||||
except Exception:
|
||||
return False
|
||||
if self.x.text == "True":
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
Reference in New Issue
Block a user