From f9b3bcd9a867336666a345cc80acc8673ef58702 Mon Sep 17 00:00:00 2001 From: Jonas Zeunert Date: Thu, 22 Aug 2024 20:29:23 +0200 Subject: [PATCH] Typehints and refactor --- code/src/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/src/main.py b/code/src/main.py index a72affc..10107d3 100644 --- a/code/src/main.py +++ b/code/src/main.py @@ -6,6 +6,7 @@ from micropyserver import MicroPyServer from micropyserver_utils import send_response, get_request_post_params import ntptime import os +import io DHT_PIN = 26 RELAY_PIN = 4 @@ -13,11 +14,11 @@ UPDATE_INTERVAL_S = 60 MAX_LOG_SIZE = 3 * 1024 * 1024 # MegaByte name = "Test Sensor" + humidity_limit_path = 'humidity_limit' sensor_log_path = 'sensors.log' -sensor_log_path = 'sensors.log' -log_file = None -log_cursor_file = None +log_file: io.TextIOWrapper +log_cursor_file: io.TextIOWrapper server = MicroPyServer() dht = dht.DHT22(Pin(DHT_PIN))