From 99d92a6e9069c63606f9b4cbea3e9c4dbae1e8e7 Mon Sep 17 00:00:00 2001 From: sickprodigy Date: Sat, 8 Nov 2025 18:38:11 -0500 Subject: [PATCH] feat: Add type ignore comments for imports in multiple scripts --- Scripts/memory_check.py | 2 +- Scripts/monitors.py | 4 ++-- Scripts/scheduler.py | 2 +- main.py | 14 +++++++------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Scripts/memory_check.py b/Scripts/memory_check.py index 8c384a1..c6c3034 100644 --- a/Scripts/memory_check.py +++ b/Scripts/memory_check.py @@ -1,4 +1,4 @@ -import gc +import gc # type: ignore def check_memory_once(): """One-time memory check (for startup diagnostics).""" diff --git a/Scripts/monitors.py b/Scripts/monitors.py index 9795345..e129b14 100644 --- a/Scripts/monitors.py +++ b/Scripts/monitors.py @@ -1,4 +1,4 @@ -import time +import time # type: ignore from scripts.discord_webhook import send_discord_message from scripts.temperature_sensor import TemperatureSensor @@ -262,7 +262,7 @@ class WiFiMonitor(Monitor): def run(self): """Check WiFi status, blink LED, attempt reconnect if needed.""" - import network + import network # type: ignore from scripts.networking import connect_wifi is_connected = self.wifi.isconnected() if self.wifi else False diff --git a/Scripts/scheduler.py b/Scripts/scheduler.py index 22c08ec..749adb1 100644 --- a/Scripts/scheduler.py +++ b/Scripts/scheduler.py @@ -1,4 +1,4 @@ -import time +import time # type: ignore class ScheduleMonitor: """Monitor that checks and applies temperature schedules.""" diff --git a/main.py b/main.py index d47e3d9..f95f796 100644 --- a/main.py +++ b/main.py @@ -1,8 +1,8 @@ from machine import Pin, WDT # type: ignore -import time -import network +import time # type: ignore +import network # type: ignore import json -import gc # ADD THIS - for garbage collection +import gc # type: ignore # ADD THIS - for garbage collection # Enable watchdog (8 seconds timeout - auto-reboot if frozen) # wdt = WDT(timeout=8000) # Maximum is 8388ms, use 8000ms (8 seconds) @@ -77,7 +77,7 @@ def load_config(): 'heater_target': 72.0 } ], - 'schedule_enabled': False, # Schedules disabled by default (user can enable via web) + 'schedule_enabled': True, # Schedules disabled by default (user can enable via web) 'permanent_hold': False # Permanent hold disabled by default } @@ -151,7 +151,7 @@ if wifi and wifi.isconnected(): # Attempt time sync non-blocking (short timeout + retry flag) ntp_synced = False try: - import ntptime + import ntptime # type: ignore ntptime.settime() ntp_synced = True print("Time synced with NTP server") @@ -316,13 +316,13 @@ while True: run_monitors(monitors) # Web requests - web_server.check_requests(sensors, ac_monitor, heater_monitor, schedule_monitor) + web_server.check_requests(sensors, ac_monitor, heater_monitor, schedule_monitor, config) # Retry NTP sync every ~10s if not yet synced if not ntp_synced and retry_ntp_attempts < max_ntp_attempts: # Try once immediately, then whenever (time.time() % 10) < 1 (rough 10s window) try: - import ntptime + import ntptime # type: ignore if retry_ntp_attempts == 0 or (time.time() % 10) < 1: ntptime.settime() ntp_synced = True