mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
P2S firmware sends local slot IDs (0-3) in tray_now, not global tray IDs, when multiple AMS units are connected. The UI highlighted the wrong AMS unit (e.g., AMS-A instead of AMS-B). Usage tracking was unaffected because it uses the MQTT mapping field. Added disambiguation in _handle_ams_data for single-nozzle printers with ams_exist_bits indicating >1 AMS: cross-references tray_now with the MQTT mapping field (snow-encoded) to resolve the correct global tray ID. Falls back to raw value when no mapping is available or ambiguous. No behavior change for single-AMS printers or dual-nozzle (H2D) printers.