예제 #1
0
def water_timed():
    print("Here we go! Press CTRL+C to exit")
    try:
        water.pump_on(output_pins[0])
        sleep(5)
    except KeyboardInterrupt:  # If CTRL+C is pressed, exit cleanly:
        water.pump_off(output_pins[0])
        water.cleanup()  # cleanup all GPIO
    water.pump_off(output_pins[0])
    templateData = template()
    return render_template('main.html', **templateData)
예제 #2
0
def action1():
    watered = water.pump_on()
    t1, t2, t3 = water.sensor_status()
    if watered == False:
        t1 = "Pump not used. " + t1
    list_object = [t1, t2, t3]
    return render_template('main.html', text_to_send=list_object)
예제 #3
0
def action2():
    water.pump_on()
    templateData = template(text = "Watered Once")
    return render_template('index.html', **templateData)
예제 #4
0
def pump():
    watered = water.pump_on()
    template_data = template(text=dict_en['pump_msg'] if watered == 0 else dict_en['not_pump_msg'])
    return render_template(html_template, **template_data)
예제 #5
0
def action2():
 water.pump_on()
 print('Pump on')
 templateData = template(text = "Watering...")
 return render_template('main.html', **templateData)
예제 #6
0
def action2():
    water.pump_on()
    message = "Plant was just watered."
    log_action(message)
    templateData = template(text=message, last_water=water.get_last_watered())
    return render_template('main.html', **templateData)
예제 #7
0
def action4():
    water.pump_on(sensor_3, relay_4_pin, wet_target)
    text = "Watered plant 4 Once"
    list_object = [text]
    return render_template('main.html', text_to_send = list_object)
예제 #8
0
def action3():
    water.pump_on(sensor_2, relay_3_pin, wet_target)
    text = "Watered plant 3 Once"
    return render_template('main.html', text_to_send = list_object)
예제 #9
0
def water_on():
    water.pump_on(output_pins[0])
    templateData = template()
    return render_template('main.html', **templateData)
예제 #10
0
def action2():
    water.pump_on()  #pumpa bekapcsolasa gombnyomasra
    templateData = template(text="Öntözés kész!")
    return render_template('main.html', **templateData)
예제 #11
0
def action2():
    water.pump_on()
    templateData = template(text="آب داده شد!")
    return render_template('main.html', **templateData)