def modeTemperature(temperatureMode):
    # ACStateインスタンス読み込み
    state = ACState(Config.context)

    # ステート変更 ログファイル追加
    if temperatureMode == "up" and state.temperature >= 30:
        flash('最大設定温度です')
    elif temperatureMode == "up":
        state.temperature += 1

    if temperatureMode == "down" and state.temperature <= 18:
        flash('最低設定温度です')
    elif temperatureMode == "down":
        state.temperature -= 1

    # stateを元に赤外線送信
    if not state.sendSignalToAC():
        flash('信号を送信できませんでした')

    # 日本語変換
    jstate = state.convertToJapanese()

    # 実験用ログ書き込み
    lffe = LogFileForExperiment(context=Config.context,
                                acstate=state,
                                ipaddr=request.remote_addr)
    lffe.write_log_file()

    return render_template('index.html', state=state, jstate=jstate)
def modeOperating(operatingMode):
    # ACStateインスタンス読み込み
    state = ACState(Config.context)

    # ステート変更 ログファイル追加
    state.operating = operatingMode

    # stateを元に赤外線送信
    if not state.sendSignalToAC():
        flash('信号を送信できませんでした')

    # 日本語変換
    jstate = state.convertToJapanese()

    # 実験用ログ書き込み
    lffe = LogFileForExperiment(context=Config.context,
                                acstate=state,
                                ipaddr=request.remote_addr)
    lffe.write_log_file()

    return render_template('index.html', state=state, jstate=jstate)