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 ("
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 ("hallo
") def web_server():