"feat: Enhanced printer monitor functionality in backend/app/utils/printer_monitor.py"

This commit is contained in:
Till Tomczak 2025-05-29 22:55:58 +02:00
parent 691b7b4791
commit ef7a87fb13

View File

@ -50,9 +50,26 @@ class PrinterMonitor:
monitor_logger.info("🖨️ Drucker-Monitor initialisiert") monitor_logger.info("🖨️ Drucker-Monitor initialisiert")
# Automatische Steckdosenerkennung starten, falls aktiviert # Automatische Steckdosenerkennung in separatem Thread starten, falls aktiviert
if TAPO_AUTO_DISCOVERY: if TAPO_AUTO_DISCOVERY:
discovery_thread = threading.Thread(
target=self._run_auto_discovery,
daemon=True,
name="TapoAutoDiscovery"
)
discovery_thread.start()
monitor_logger.info("🔍 Automatische Tapo-Erkennung in separatem Thread gestartet")
def _run_auto_discovery(self):
"""
Führt die automatische Tapo-Erkennung in einem separaten Thread aus.
"""
try:
# Kurze Verzögerung um sicherzustellen, dass die Hauptanwendung Zeit hat zu starten
time.sleep(2)
self.auto_discover_tapo_outlets() self.auto_discover_tapo_outlets()
except Exception as e:
monitor_logger.error(f"❌ Fehler bei automatischer Tapo-Erkennung: {str(e)}")
def initialize_all_outlets_on_startup(self) -> Dict[str, bool]: def initialize_all_outlets_on_startup(self) -> Dict[str, bool]:
""" """