mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-18 11:56:01 +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:
@@ -3908,7 +3908,13 @@ function PrinterCard({
|
||||
const chamberFanLabel = isExhaustModel
|
||||
? t('printers.fans.exhaust')
|
||||
: t('printers.fans.chamber');
|
||||
const showChamberFan = isExhaustModel ? status.exhaust_fan_present : hasChamberFan;
|
||||
// Composed rather than either/or so both lists stay live for
|
||||
// P2S/X2D: the model must have an enclosure fan at all, AND —
|
||||
// where that fan is an add-on kit — actually report it. Written
|
||||
// as `isExhaustModel ? exhaust_fan_present : hasChamberFan` the
|
||||
// P2S/X2D entries in MODELS_WITH_CHAMBER_FAN became unreachable,
|
||||
// which reads as if removing them were safe.
|
||||
const showChamberFan = hasChamberFan && (!isExhaustModel || status.exhaust_fan_present);
|
||||
const fanItems: {
|
||||
key: string;
|
||||
label: string;
|
||||
|
||||
Reference in New Issue
Block a user