-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_web_gui_only.py
More file actions
70 lines (55 loc) · 1.77 KB
/
Copy pathtest_web_gui_only.py
File metadata and controls
70 lines (55 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
"""
Test der Web-GUI ohne PyMammotion-Abhängigkeiten
Zeigt die robuste Web-Oberfläche mit großen UI-Elementen.
"""
import sys
import os
import logging
# Pfad für Imports hinzufügen
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
from views.web_gui import WebGUI
def test_web_gui():
"""Test-Funktion für die Web-GUI"""
def on_login(email, password, remember):
print(f"Login-Test: {email}, {password}, {remember}")
# Simuliere erfolgreichen Login
if email and password:
return True
else:
return False
def on_command(device_id, command):
print(f"Command-Test: {device_id}, {command}")
return True # Simuliere erfolgreichen Befehl
print("=== Mammotion Web-GUI Test ===")
print()
print("✓ Web-basierte Benutzeroberfläche")
print("✓ Große UI-Elemente (80px Eingabefelder)")
print("✓ Responsive Design")
print("✓ Plattformunabhängig")
print("✓ Keine Qt-Probleme")
print()
print("Starte Web-Server auf http://localhost:5000")
print("Browser öffnet sich automatisch...")
print()
print("Drücken Sie Ctrl+C zum Beenden")
print()
# Web-GUI erstellen
gui = WebGUI(port=5000)
gui.set_login_callback(on_login)
gui.set_command_callback(on_command)
# Test-Mäher-Daten
gui.update_mower_data({
'status': 'Bereit',
'battery_level': 85,
'position': 'Ladestation',
'model': 'Luba 2 AWD',
'name': 'Test-Mäher'
})
try:
gui.start(open_browser=True)
except KeyboardInterrupt:
print("\nWeb-GUI Test beendet")
except Exception as e:
print(f"Fehler: {e}")
if __name__ == "__main__":
test_web_gui()