mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 03:01:21 +02:00
Fix wrong AMS unit displayed with dual AMS on P2S (#420)
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.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
┌─────────────────┬─────────────────┬────────────────┬────────────────────────────────────┬─────────────────────┐
|
||||
│ Model │ _is_dual_nozzle │ ams_exist_bits │ Branch hit │ Behavior │
|
||||
├─────────────────┼─────────────────┼────────────────┼────────────────────────────────────┼─────────────────────┤
|
||||
│ X1C/X1E (1 AMS) │ False │ "1" │ New elif → num_ams=1 → passthrough │ Unchanged │
|
||||
├─────────────────┼─────────────────┼────────────────┼────────────────────────────────────┼─────────────────────┤
|
||||
│ X1C (2 AMS) │ False │ "3" │ New elif → disambiguation │ Fixed (same as P2S) │
|
||||
├─────────────────┼─────────────────┼────────────────┼────────────────────────────────────┼─────────────────────┤
|
||||
│ P1S/P1P (1 AMS) │ False │ "1" │ New elif → num_ams=1 → passthrough │ Unchanged │
|
||||
├─────────────────┼─────────────────┼────────────────┼────────────────────────────────────┼─────────────────────┤
|
||||
│ A1/A1 Mini │ False │ "1" or missing │ New elif → num_ams≤1 → passthrough │ Unchanged │
|
||||
├─────────────────┼─────────────────┼────────────────┼────────────────────────────────────┼─────────────────────┤
|
||||
│ P2S (1 AMS) │ False │ "1" │ New elif → num_ams=1 → passthrough │ Unchanged │
|
||||
├─────────────────┼─────────────────┼────────────────┼────────────────────────────────────┼─────────────────────┤
|
||||
│ P2S (2 AMS) │ False │ "3" │ New elif → disambiguation │ Fixed │
|
||||
├─────────────────┼─────────────────┼────────────────┼────────────────────────────────────┼─────────────────────┤
|
||||
│ H2D/H2D Pro │ True │ any │ Branch 1 (H2D logic) │ Unchanged │
|
||||
├─────────────────┼─────────────────┼────────────────┼────────────────────────────────────┼─────────────────────┤
|
||||
│ H2C │ True │ any │ Branch 1 (H2D logic) │ Unchanged │
|
||||
├─────────────────┼─────────────────┼────────────────┼────────────────────────────────────┼─────────────────────┤
|
||||
│ tray_now=255 │ any │ any │ Branch 3 (passthrough) │ Unchanged │
|
||||
├─────────────────┼─────────────────┼────────────────┼────────────────────────────────────┼─────────────────────┤
|
||||
│ tray_now=254 │ any │ any │ Branch 3 (passthrough) │ Unchanged │
|
||||
├─────────────────┼─────────────────┼────────────────┼────────────────────────────────────┼─────────────────────┤
|
||||
│ tray_now 4-15 │ any (False) │ any │ Branch 3 (passthrough) │ Unchanged │
|
||||
└─────────────────┴─────────────────┴────────────────┴────────────────────────────────────┴─────────────────────┘
|
||||
Reference in New Issue
Block a user