Пример #1
0
def command_radio():
    command = request.args.get('command', '')
    if command == "on":
        remote_audio.radio()

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

    return redirect(url_for('index'))
Пример #2
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'))