Ejemplo n.º 1
0
def pumpon():
    GPIO.output(pump, 1) # off pump
    pump_status = 1 # flag on
    text = "Pump ON:" + time.strftime("%d.%m.%Y %H:%M:%S")
    print(text)
    sql_lightlog.pump(1, 1)
    bot_post.send_to_farm(text)
Ejemplo n.º 2
0
def pumpoff():
    GPIO.output(pump, 0)  # off light
    text = "Pump OFF:" + time.strftime("%d.%m.%Y %H:%M:%S")
    print(text)
    sql_lightlog.pump(0, 1)
    sql_lightlog.pump_web(0, 1)
    bot_post.send_to_farm(text)
    global pump_status
    pump_status = 0
Ejemplo n.º 3
0
def lightoff():  #выключение света
    GPIO.output(light, 0)  # off light
    text = "Light OFF:" + time.strftime("%d.%m.%Y %H:%M:%S")
    print(text)
    sql_lightlog.light(0, 1)
    sql_lightlog.light_web(0, 1)
    bot_post.send_to_farm(text)
    global light_status
    light_status = 0
Ejemplo n.º 4
0
def lighton():  #включение света
    GPIO.output(light, 1)  # on light
    text = "Light ON:" + time.strftime("%d.%m.%Y %H:%M:%S")
    print(text)
    sql_lightlog.light(1, 1)
    sql_lightlog.light_web(1, 1)
    bot_post.send_to_farm(text)  # отправка в бот
    global light_status
    light_status = 1
Ejemplo n.º 5
0
def lightoff():
    GPIO.output(light, 0) # off light
    text = "Light OFF:" + time.strftime("%d.%m.%Y %H:%M:%S")
    print(text)
    sql_lightlog.light(0, 1)
    bot_post.send_to_farm(text)
Ejemplo n.º 6
0
def lighton():
    GPIO.output(light, 1) # on light
    text = "Light ON:" + time.strftime("%d.%m.%Y %H:%M:%S")
    print(text)
    sql_lightlog.light(1, 1)
    bot_post.send_to_farm(text)