1
0

verander website naar self

This commit is contained in:
2025-06-29 02:03:27 +02:00
parent 38a96bb61d
commit 308029ca82

View File

@@ -9,8 +9,6 @@ sensor = adafruit_dht.DHT11(board.D6)
LED_PIN = 21 LED_PIN = 21
FAN_PIN = 22 FAN_PIN = 22
website = http.server.BaseHTTPRequestHandler
GPIO.setmode(GPIO.BCM) GPIO.setmode(GPIO.BCM)
GPIO.setup(LED_PIN, GPIO.OUT) GPIO.setup(LED_PIN, GPIO.OUT)
GPIO.setup(FAN_PIN, GPIO.OUT) GPIO.setup(FAN_PIN, GPIO.OUT)
@@ -31,10 +29,11 @@ def check_data():
GPIO.output(FAN_PIN, GPIO.LOW) GPIO.output(FAN_PIN, GPIO.LOW)
class handler_class(http.server.BaseHTTPRequestHandler): class handler_class(http.server.BaseHTTPRequestHandler):
if website.path == '/': def do_WEB (self):
website.send_response(200) if self.path == '/':
website.send_header('Content-type', 'text/html; charset=utf-8') self.send_response(200)
website.wfile.write ("<html><head><title>gedoe</title></head><body><h1>hallo</h1><hr><p>hallo</p></body></html>") self.send_header('Content-type', 'text/html; charset=utf-8')
self.wfile.write ("<html><head><title>gedoe</title></head><body><h1>hallo</h1><hr><p>hallo</p></body></html>")
def web_server(): def web_server():