Typehints and refactor

This commit is contained in:
Jonas Zeunert
2024-08-22 20:29:23 +02:00
parent 550eeb4945
commit f9b3bcd9a8

View File

@@ -6,6 +6,7 @@ from micropyserver import MicroPyServer
from micropyserver_utils import send_response, get_request_post_params from micropyserver_utils import send_response, get_request_post_params
import ntptime import ntptime
import os import os
import io
DHT_PIN = 26 DHT_PIN = 26
RELAY_PIN = 4 RELAY_PIN = 4
@@ -13,11 +14,11 @@ UPDATE_INTERVAL_S = 60
MAX_LOG_SIZE = 3 * 1024 * 1024 # MegaByte MAX_LOG_SIZE = 3 * 1024 * 1024 # MegaByte
name = "Test Sensor" name = "Test Sensor"
humidity_limit_path = 'humidity_limit' humidity_limit_path = 'humidity_limit'
sensor_log_path = 'sensors.log' sensor_log_path = 'sensors.log'
sensor_log_path = 'sensors.log' log_file: io.TextIOWrapper
log_file = None log_cursor_file: io.TextIOWrapper
log_cursor_file = None
server = MicroPyServer() server = MicroPyServer()
dht = dht.DHT22(Pin(DHT_PIN)) dht = dht.DHT22(Pin(DHT_PIN))