示例#1
0
def command_tv():
    command = request.args.get('command', '')

    if command == "on":
        remote_sky.standby()
        remote_tv.standby()
        remote_audio.optical()

    if command == "off":
        remote_sky.standby()
        remote_tv.standby()
        remote_audio.standby()

    if command == "switch":
        channel = request.args.get('channel', '')
        remote_sky.switch(channel)

    sys.stdout.flush()

    return redirect(url_for('index'))
示例#2
0
def channelSwitch(channel):
    remote_sky.switch(channel)
    return channel