mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
PR #939 added the awaiting_plate_clear gate but stored it on PrinterManager, not on PrinterState. printer_state_to_dict() — which builds every WebSocket printer_status payload — never emitted the flag, so the frontend's WS merge preserved the stale false value. The only path that surfaced true was the 30s HTTP fallback poll, and incoming WS ticks kept bumping React Query's dataUpdatedAt, pushing the refetch out further on chatty printers. Emit awaiting_plate_clear from printer_state_to_dict by reading printer_manager.is_awaiting_plate_clear(printer_id) directly; returns False when no id is passed. No frontend change needed — the existing WS merge carries the flag end-to-end and the button now appears the instant the printer transitions to FINISH. Regression tests assert the WS dict always contains the key and surfaces True when the manager has the flag set for that printer_id. Affects every printer (A1/H2D/X1C) equally — transport-agnostic path.