mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-20 00:38:38 +02:00
fix(printers): don't retract a fan kit on a partial airduct frame
device.airduct is pushed field by field - the modeCur handler reads it with an "in" check for that reason - so a frame can carry parts without carrying every fan. Absence in that list is what tells us a kit is not fitted, and taken from a truncated frame it made both accessory badges vanish mid-print and started rejecting fan=aux2 on a printer that has the fan. A parts list now counts as a full inventory only when it carries ids 1 (part cooling) and 2 (aux). Neither is optional on a machine that reports an airduct at all, and both appear in every layout in the support-package archive - P2S base 1,2 / P2S+kit 1,2,3 / X2D 1,2,3,10 / H2C,H2D,H2S 1,2,3,6. Anything narrower is a diff frame: its speeds are applied, presence is left alone. Presence can still be added from a partial frame; only retraction needs the full list, so a kit that really is removed still disappears. Also compose showChamberFan from both model lists rather than branching between them, so the P2S/X2D entries in MODELS_WITH_CHAMBER_FAN stay reachable instead of reading as dead, and note in the fan-speed docstring that the aux2 gate also rejects between connect and the first airduct push.
This commit is contained in:
@@ -3208,6 +3208,11 @@ async def set_fan_speed(
|
||||
profile gcode does. It only exists when the printer reports airduct part 10,
|
||||
so the request is rejected rather than sending M106 P10 into the void on a
|
||||
machine that has no such fan.
|
||||
|
||||
That gate also rejects for the short window between connecting and the
|
||||
first airduct push, when nothing is known about the fan yet. The card hides
|
||||
the badge over the same window, so there is no control to click; a direct
|
||||
API caller gets a 400 and should retry once the status reports the fan.
|
||||
"""
|
||||
fan_ids = {"part": 1, "aux": 2, "chamber": 3, "aux2": 10}
|
||||
fan_id = fan_ids.get(fan)
|
||||
|
||||
Reference in New Issue
Block a user