1
0

Compare commits

...

2 Commits

Author SHA1 Message Date
floristhebeast
a4d6f69450 voeg LED toe 2025-06-30 20:47:39 +02:00
floristhebeast
5de9255526 voeg een else toe voor als de contitions niet kloppen 2025-06-30 20:43:00 +02:00

View File

@@ -52,12 +52,23 @@ def check_data():
fan_timer_actief = True
fan_timer_start = time.time()
sensor_data['fan'] = True
sensor_data['led'] = False
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
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)
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):
def do_GET (self):