From 308029ca82beb47f7713b55812e68a369c59bb10 Mon Sep 17 00:00:00 2001 From: florisdebeast Date: Sun, 29 Jun 2025 02:03:27 +0200 Subject: [PATCH] verander website naar self --- dht11.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dht11.py b/dht11.py index 33a038d..a72acd5 100644 --- a/dht11.py +++ b/dht11.py @@ -9,8 +9,6 @@ sensor = adafruit_dht.DHT11(board.D6) LED_PIN = 21 FAN_PIN = 22 -website = http.server.BaseHTTPRequestHandler - GPIO.setmode(GPIO.BCM) GPIO.setup(LED_PIN, GPIO.OUT) GPIO.setup(FAN_PIN, GPIO.OUT) @@ -31,10 +29,11 @@ def check_data(): GPIO.output(FAN_PIN, GPIO.LOW) class handler_class(http.server.BaseHTTPRequestHandler): - if website.path == '/': - website.send_response(200) - website.send_header('Content-type', 'text/html; charset=utf-8') - website.wfile.write ("gedoe

hallo


hallo

") + def do_WEB (self): + if self.path == '/': + self.send_response(200) + self.send_header('Content-type', 'text/html; charset=utf-8') + self.wfile.write ("gedoe

hallo


hallo

") def web_server():