예제 #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)
예제 #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)
예제 #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"
예제 #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"
예제 #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)
예제 #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)
예제 #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"
예제 #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"