Compare commits
2 Commits
27aaf239c7
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4d6f69450 | ||
|
|
5de9255526 |
11
dht11.py
11
dht11.py
@@ -52,12 +52,23 @@ def check_data():
|
|||||||
fan_timer_actief = True
|
fan_timer_actief = True
|
||||||
fan_timer_start = time.time()
|
fan_timer_start = time.time()
|
||||||
sensor_data['fan'] = True
|
sensor_data['fan'] = True
|
||||||
|
sensor_data['led'] = False
|
||||||
GPIO.output(FAN_PIN, GPIO.HIGH)
|
GPIO.output(FAN_PIN, GPIO.HIGH)
|
||||||
|
GPIO.output(LED_PIN, GPIO.LOW)
|
||||||
elif sensor_data['fan'] == True and fan_timer_actief == True and time.time() - fan_timer_start > 300: # 5 minuten
|
elif sensor_data['fan'] == True and fan_timer_actief == True and time.time() - fan_timer_start > 300: # 5 minuten
|
||||||
fan_timer_actief = False
|
fan_timer_actief = False
|
||||||
fan_timer_start = 0
|
fan_timer_start = 0
|
||||||
sensor_data['fan'] = False
|
sensor_data['fan'] = False
|
||||||
|
sensor_data['led'] = False
|
||||||
GPIO.output(FAN_PIN, GPIO.LOW)
|
GPIO.output(FAN_PIN, GPIO.LOW)
|
||||||
|
GPIO.output(LED_PIN, GPIO.LOW)
|
||||||
|
else:
|
||||||
|
fan_timer_actief = False
|
||||||
|
fan_timer_start = 0
|
||||||
|
sensor_data['fan'] = False
|
||||||
|
sensor_data['led'] = False
|
||||||
|
GPIO.output(FAN_PIN, GPIO.LOW)
|
||||||
|
GPIO.output(LED_PIN, GPIO.LOW)
|
||||||
|
|
||||||
class handler_class(http.server.BaseHTTPRequestHandler):
|
class handler_class(http.server.BaseHTTPRequestHandler):
|
||||||
def do_GET (self):
|
def do_GET (self):
|
||||||
|
|||||||
Reference in New Issue
Block a user