Example #1
0
def ping(IP_DEVICE, connected):

    print("ping ", IP_DEVICE)

    proc = subprocess.Popen(["ping", IP_DEVICE], stdout=subprocess.PIPE)

    found = False

    while True:
        line = proc.stdout.readline()
        if not line:
            break
        line = line.decode("utf-8")
        # condizione bruttissima ma per ora รจ l'unica idea che ho avuto
        if line.find("Tempo") != -1:
            found = True
            if not connected:
                connected = True
                status(connected)
                play()
            break

    if not found:
        connected = False
        status(connected)
        pause()

    return connected
Example #2
0
def nextHandler():
	spotify.pause()
	spotify.next()
	json = spotify.currentTrack()
	spotify.play()
	return json
Example #3
0
def pauseHandler():
	spotify.pause()
	return spotify.currentTrack()
Example #4
0
def previousHandler():
	spotify.pause()
	spotify.previous()
	json = spotify.currentTrack()
	spotify.play()
	return json