Przeglądaj źródła

P2S - enable AMS drying for firmware 01.02.00.00 and later

maziggy 1 miesiąc temu
rodzic
commit
648f7d6ba8

+ 3 - 0
CHANGELOG.md

@@ -4,6 +4,9 @@ All notable changes to Bambuddy will be documented in this file.
 
 ## [0.2.3b3] - Unreleased
 
+### Improved
+- **AMS Drying Support for P2S** — Remote AMS drying and queue auto-drying now work on P2S printers with firmware 01.02.00.00 or later. Previously P2S was hard-blocked from the drying feature.
+
 ### New Features
 - **LDAP Default Fallback Group** — Settings → Authentication → LDAP → Advanced now has a "Default group" selector. When an LDAP user authenticates but is not listed in any mapped LDAP group, they are automatically assigned to this fallback group instead of being left without permissions. Previously such users could log in successfully but landed on empty pages because every permission check failed. Leave the setting empty to preserve the old behavior. A warning is logged each time the fallback is applied so administrators can spot missing group assignments.
 

+ 3 - 3
backend/app/services/printer_manager.py

@@ -105,11 +105,11 @@ _DRYING_MIN_FIRMWARE: dict[str, str] = {
     "X1C": "01.09.00.00",
     "P1P": "01.08.00.00",
     "P1S": "01.08.00.00",
+    "P2S": "01.02.00.00",
+    "N7": "01.02.00.00",  # P2S internal model code
 }
 # Models that definitely don't support AMS drying (no AMS 2 Pro / AMS-HT compatibility)
-_DRYING_UNSUPPORTED_MODELS = frozenset(
-    {"P2S", "A1", "A1MINI", "A1-MINI", "A1 MINI", "H2C", "N7", "O1C", "O1C2", "O1S", "N1", "N2S"}
-)
+_DRYING_UNSUPPORTED_MODELS = frozenset({"A1", "A1MINI", "A1-MINI", "A1 MINI", "H2C", "O1C", "O1C2", "O1S", "N1", "N2S"})
 
 
 def supports_drying(model: str | None, firmware: str | None) -> bool:

+ 8 - 2
backend/tests/unit/services/test_printer_manager.py

@@ -1070,20 +1070,25 @@ class TestSupportsDrying:
         assert supports_drying("P1S", "01.08.00.00") is True
         assert supports_drying("H2D", "01.02.30.00") is True
         assert supports_drying("H2S", "01.02.00.00") is True
+        assert supports_drying("P2S", "01.02.00.00") is True
+        assert supports_drying("N7", "01.02.00.00") is True
 
     def test_known_supported_old_firmware(self):
         """Verify known models with old firmware return False."""
         assert supports_drying("X1C", "01.08.00.00") is False
         assert supports_drying("P1S", "01.07.00.00") is False
         assert supports_drying("H2S", "01.01.00.00") is False
+        assert supports_drying("P2S", "01.01.99.99") is False
+        assert supports_drying("N7", "01.01.99.99") is False
 
     def test_known_supported_no_firmware(self):
         """Verify known models with no firmware return False."""
         assert supports_drying("X1C", None) is False
+        assert supports_drying("P2S", None) is False
 
     def test_unsupported_models(self):
         """Verify models without AMS drying support return False regardless of firmware."""
-        for model in ["P2S", "A1", "A1MINI", "A1-MINI", "H2C", "N7", "N1", "N2S"]:
+        for model in ["A1", "A1MINI", "A1-MINI", "H2C", "N1", "N2S"]:
             assert supports_drying(model, "99.99.99.99") is False, f"Expected False for {model}"
 
     def test_unknown_models_allowed(self):
@@ -1107,7 +1112,8 @@ class TestSupportsDrying:
     def test_case_insensitive(self):
         """Verify model matching is case-insensitive."""
         assert supports_drying("x1c", "01.09.00.00") is True
-        assert supports_drying("p2s", "99.99.99.99") is False
+        assert supports_drying("p2s", "01.02.00.00") is True
+        assert supports_drying("a1", "99.99.99.99") is False
 
 
 class TestGetDerivedStatusName: