Grotti 3.2.0: Jetzt-Liste, Filament-Pause, Strom-Torte, UI-Polish.
Jetzt/Topbar und Material-Routing, Pause bei Filament-Ende, Druckbericht mit Stromanteilen, Design- und Kamera-Stream-Polish; Bedarf-Alert-Spam und Platte-belegt-Bugs behoben.
This commit is contained in:
1 parent
6e59df22e5
commit
4ddffbbeb1
68 files changed
+4348
-1215
No files matched your search
@@ -0,0 +1,43 @@
|
||||
"""Filament-Pause-Heuristik aus ACE/mmu und Meldungen."""
|
||||
|
||||
import unittest
|
||||
|
||||
from grotti.moonraker import filament_out_hint
|
||||
|
||||
|
||||
class FilamentOutHintTests(unittest.TestCase):
|
||||
def test_message_10107(self):
|
||||
code, text = filament_out_hint({}, "Report code 10107")
|
||||
self.assertEqual(code, "message")
|
||||
self.assertIn("10107", text)
|
||||
|
||||
def test_active_filament_empty(self):
|
||||
code, text = filament_out_hint({"active_filament": {"empty": True}})
|
||||
self.assertEqual(code, "active_empty")
|
||||
self.assertIn("leer", text.lower())
|
||||
|
||||
def test_gate_status_zero_for_tool(self):
|
||||
code, text = filament_out_hint({
|
||||
"tool": 2,
|
||||
"gate_status": [1, 1, 0, 1],
|
||||
"active_filament": {"type": "PLA"},
|
||||
})
|
||||
self.assertEqual(code, "gate_empty")
|
||||
self.assertIn("3", text)
|
||||
|
||||
def test_mmu_paused_without_active_type(self):
|
||||
code, text = filament_out_hint({
|
||||
"is_paused": True,
|
||||
"active_filament": {},
|
||||
})
|
||||
self.assertEqual(code, "mmu_paused")
|
||||
self.assertTrue(text)
|
||||
|
||||
def test_no_hint_for_plain_pause(self):
|
||||
code, text = filament_out_hint({"tool": 0, "gate_status": [1, 1]}, "paused")
|
||||
self.assertIsNone(code)
|
||||
self.assertIsNone(text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user