Ejemplo n.º 1
0
def status(device):
    # Create PLAY/PAUSE message
    msg = new_msg()
    msg["cmd"] = "STATUS"
    msg["device"] = device

    # Send message to Command Center
    s = libcc.client_send_recv(msg)

    # Return String version of JSON packet
    return json.dumps(s)
Ejemplo n.º 2
0
def status(device):
	# Create PLAY/PAUSE message
	msg = new_msg()
	msg["cmd"]="STATUS"
	msg["device"]=device 

	# Send message to Command Center
	s = libcc.client_send_recv(msg)

	# Return String version of JSON packet
	return json.dumps(s)
Ejemplo n.º 3
0
def play_pause(device):
    # Create PLAY/PAUSE message
    msg = new_msg()
    msg["cmd"] = "PLAYPAUSE"
    msg["device"] = device

    # Send message to Command Center
    ret = libcc.client_send_recv(msg)
    if "error" in ret:
        return "Error Toggling Playback: " + repr(ret)
    else:
        return "Playback Toggled"
Ejemplo n.º 4
0
def play_pause(device):
	# Create PLAY/PAUSE message
	msg = new_msg()
	msg["cmd"] = "PLAYPAUSE"
	msg["device"] = device

	# Send message to Command Center
	ret = libcc.client_send_recv(msg)
	if "error" in ret:
		return "Error Toggling Playback: "+repr(ret)
	else:
		return "Playback Toggled"
Ejemplo n.º 5
0
def skip(device, percent):
    # Create Jump message
    msg = new_msg()
    msg["cmd"] = "SKIP"
    msg["percent"] = percent
    msg["device"] = device

    # Send message to Command Center
    ret = libcc.client_send_recv(msg)
    if "error" in ret:
        return "Error Skipping: " + repr(ret)
    else:
        return "Skipped to percent: " + str(percent)
Ejemplo n.º 6
0
def skip(device,percent):
	# Create Jump message
	msg = new_msg()
	msg["cmd"] = "SKIP"
	msg["percent"] = percent
	msg["device"] = device

	# Send message to Command Center
	ret = libcc.client_send_recv(msg)
	if "error" in ret:
		return "Error Skipping: "+repr(ret)
	else:
		return "Skipped to percent: "+str(percent)
Ejemplo n.º 7
0
def load_video(device, key):
    # Create "LOAD" message
    msg = new_msg()
    msg["cmd"] = "LOAD"
    msg["key"] = key
    msg["device"] = device

    # Send message to Command Center and get response
    ret = libcc.client_send_recv(msg)

    if "error" in ret:
        return "Error Loading Video: " + repr(ret)
    else:
        return "Video Loaded"
Ejemplo n.º 8
0
def load_video(device,key):
	# Create "LOAD" message
	msg = new_msg()
	msg["cmd"] = "LOAD"
	msg["key"] = key
	msg["device"] = device

	# Send message to Command Center and get response
	ret = libcc.client_send_recv(msg)

	if "error" in ret:
		return "Error Loading Video: "+repr(ret)
	else:
		return "Video Loaded"