📝 🚀 Improved calendar and printer functionalities, refactored logs, and updated tests. 🖥️📅
This commit is contained in:
@ -11,7 +11,7 @@ from utils.logging_config import get_logger
|
||||
from models import Job, Printer, get_db_session
|
||||
from utils.utilities_collection import TAPO_USERNAME, TAPO_PASSWORD
|
||||
from utils.hardware_integration import tapo_controller
|
||||
from utils.tapo_status_manager import tapo_status_manager
|
||||
from utils.hardware_integration import printer_monitor
|
||||
# Legacy function - use tapo_controller.test_connection instead
|
||||
def test_tapo_connection(*args, **kwargs):
|
||||
return tapo_controller.test_connection(*args, **kwargs)
|
||||
@ -627,7 +627,7 @@ class BackgroundTaskScheduler:
|
||||
"""
|
||||
try:
|
||||
from models import get_db_session, Job
|
||||
from utils.tapo_status_manager import tapo_status_manager
|
||||
from utils.hardware_integration import printer_monitor
|
||||
|
||||
db_session = get_db_session()
|
||||
now = datetime.now()
|
||||
@ -643,7 +643,7 @@ class BackgroundTaskScheduler:
|
||||
self.logger.info(f"Starte geplanten Job {job.id} für Drucker {job.printer_id}")
|
||||
|
||||
# Steckdose einschalten
|
||||
success, msg = tapo_status_manager.control_plug(job.printer_id, "on")
|
||||
success, msg = printer_monitor.control_plug(job.printer_id, "on")
|
||||
|
||||
if success:
|
||||
job.status = "running"
|
||||
@ -671,7 +671,7 @@ class BackgroundTaskScheduler:
|
||||
self.logger.info(f"Beende Job {job.id} für Drucker {job.printer_id}")
|
||||
|
||||
# Steckdose ausschalten
|
||||
success, msg = tapo_status_manager.control_plug(job.printer_id, "off")
|
||||
success, msg = printer_monitor.control_plug(job.printer_id, "off")
|
||||
|
||||
if success:
|
||||
job.status = "finished"
|
||||
|
Reference in New Issue
Block a user