Explorar el Código

Fixed error in scheduler

maziggy hace 3 meses
padre
commit
4cbcac82e3
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      backend/app/services/bambu_mqtt.py

+ 2 - 0
backend/app/services/bambu_mqtt.py

@@ -2031,6 +2031,8 @@ class BambuMQTTClient:
             ams_mapping2 = []
             if ams_mapping is not None:
                 for tray_id in ams_mapping:
+                    # Ensure tray_id is an integer (may be string from JSON)
+                    tray_id = int(tray_id) if tray_id is not None else -1
                     if tray_id == -1 or tray_id == 255:
                         ams_mapping2.append({"ams_id": 255, "slot_id": 255})
                     else: