🎉 Feat: Enhanced Printer Management System

This commit introduces a comprehensive overhaul of the printer management system, enhancing its functionality and user experience. The following changes have been implemented:

- backend/blueprints/__pycache__/admin_unified.cpython-311.pyc: Updated for improved admin interface integration.
- backend/blueprints/__pycache__/drucker_steuerung.cpython-311.pyc
This commit is contained in:
2025-06-19 22:34:54 +02:00
parent 9696cdcc3f
commit 78a9f9545f
25 changed files with 332 additions and 38 deletions

View File

@@ -74,7 +74,8 @@ def tapo_dashboard():
# Status der Steckdose prüfen
try:
reachable, status = tapo_controller.check_outlet_status(
controller = get_tapo_controller()
reachable, status = controller.check_outlet_status(
tapo_ip,
printer_id=printer_id
)
@@ -195,7 +196,8 @@ def control_outlet():
# Steckdose schalten
state = action == 'on'
success = tapo_controller.toggle_plug(ip, state)
controller = get_tapo_controller()
success = controller.toggle_plug(ip, state)
if success:
action_text = "eingeschaltet" if state else "ausgeschaltet"
@@ -241,7 +243,8 @@ def get_outlet_status(ip):
}), 400
# Status prüfen
reachable, status = tapo_controller.check_outlet_status(ip)
controller = get_tapo_controller()
reachable, status = controller.check_outlet_status(ip)
return jsonify({
'success': True,
@@ -267,7 +270,8 @@ def discover_outlets():
tapo_logger.info(f"🔍 Starte Tapo-Steckdosen-Erkennung auf Anfrage von {current_user.name}")
# Discovery starten
results = tapo_controller.auto_discover_outlets()
controller = get_tapo_controller()
results = controller.auto_discover_outlets()
success_count = sum(1 for success in results.values() if success)
total_count = len(results)
@@ -304,7 +308,8 @@ def test_connection(ip):
}), 400
# Verbindung testen
test_result = tapo_controller.test_connection(ip)
controller = get_tapo_controller()
test_result = controller.test_connection(ip)
return jsonify({
'success': True,
@@ -342,7 +347,8 @@ def get_all_status():
for printer in printers_with_tapo:
try:
tapo_logger.debug(f"Prüfe Status für {printer.plug_ip} ({printer.name})")
reachable, status = tapo_controller.check_outlet_status(
controller = get_tapo_controller()
reachable, status = controller.check_outlet_status(
printer.plug_ip,
printer_id=printer.id
)
@@ -431,7 +437,8 @@ def manual_control():
if action == 'status':
# Status abfragen
reachable, status = tapo_controller.check_outlet_status(ip)
controller = get_tapo_controller()
reachable, status = controller.check_outlet_status(ip)
if reachable:
flash(f'Steckdose {ip} ist {status.upper()}', 'success')
else:
@@ -439,7 +446,8 @@ def manual_control():
else:
# Ein/Ausschalten
state = action == 'on'
success = tapo_controller.toggle_plug(ip, state)
controller = get_tapo_controller()
success = controller.toggle_plug(ip, state)
if success:
action_text = "eingeschaltet" if state else "ausgeschaltet"
@@ -482,7 +490,8 @@ def control_outlet_form():
# Steckdose schalten
state = action == 'on'
success = tapo_controller.toggle_plug(ip, state)
controller = get_tapo_controller()
success = controller.toggle_plug(ip, state)
if success:
action_text = "eingeschaltet" if state else "ausgeschaltet"
@@ -520,7 +529,8 @@ def test_connection_form():
return redirect(url_for('tapo.tapo_dashboard'))
# Verbindung testen
test_result = tapo_controller.test_connection(ip)
controller = get_tapo_controller()
test_result = controller.test_connection(ip)
if test_result.get('success', False):
flash(f'✅ Verbindung zu {ip} erfolgreich!', 'success')