bambuddy/backend/app/services/virtual_printer
maziggy 2e45893dd5 feat(print-options): add "Auto" state to bed levelling, flow & nozzle-offset calibration
Bed levelling, flow calibration, and nozzle-offset calibration were on/off
only, so the sole way to run bed levelling was to force a full level before
every print. Bambu Studio has always offered a third "Auto" state that lets
the printer skip the calibration when it was done recently -- the state most
users actually want. Make these three options tri-state (off/on/auto),
defaulting to auto, and leave vibration/layer-inspect/timelapse as on/off
(Bambu Studio exposes no auto for those).

Wire encoding follows Bambu Studio's source exactly: each option sends a JSON
bool (true only for "on") plus a companion int -- off=0, on=1, auto=2. The
bool fields stay booleans (the #1478 H2S regression); only the companion int
widened from {0,1} to {0,1,2}. #1721's observation that stage 8/39 stays
queued when sending 2 is the auto contract (queued, skipped at runtime if
recent), not a broken "off".

- schemas: TriState = Literal[off/on/auto] with a BeforeValidator coercing
  legacy bool / 0-1 / true-false so old clients and un-migrated rows validate
- model + migration: boolean columns -> String; SQLite via column affinity +
  data backfill, PostgreSQL via ALTER COLUMN TYPE guarded on information_schema
  (verified on both dialects); settings rows normalised true/false -> on/off
- MQTT: start_print takes the tri-state strings and emits the paired bool+int
- Virtual Printer: reconstructs the slicer's auto/on/off from the int companion
  (auto_bed_leveling / extrude_cali_flag) in both capture paths
- frontend: CalibrationMode type; off/auto/on segmented controls in the print
  dialog, queue bulk-edit, and Settings -> Workflow; calibrationMode_* strings
  in all 11 locales
2026-07-20 17:55:56 +02:00
..
__init__.py
_debug.py debug(vp): env-flagged bridge-synthesised reply trace for slicer↔printer #1622 round-3 triage 2026-06-11 15:09:24 +02:00
bind_server.py fix(virtual-printer): #1610 add Bambu cipher pin to every slicer-facing TLS context 2026-06-03 10:04:37 +02:00
certificate.py fix(virtual-printer): #1558 Send pre-flight + slicer-surface audit bundle 2026-05-30 13:34:10 +02:00
diagnostic.py fix(virtual-printer): #1558 Send pre-flight + slicer-surface audit bundle 2026-05-30 13:34:10 +02:00
ftp_server.py fix(vp): stop uvloop from silently truncating VP FTP uploads (#1896) 2026-07-05 10:32:13 +02:00
manager.py feat(print-options): add "Auto" state to bed levelling, flow & nozzle-offset calibration 2026-07-20 17:55:56 +02:00
mqtt_bridge.py fix(vp): apply tray_exist_bits empty-slot cleanup to slicer-facing cache (#1726) 2026-06-13 08:42:59 +02:00
mqtt_server.py feat(vp): mirror live print progress to the slicer (#1887) 2026-07-11 10:06:03 +02:00
ssdp_server.py fix(virtual-printer): #1558 Send pre-flight + slicer-surface audit bundle 2026-05-30 13:34:10 +02:00
tailscale.py fix(virtual-printer): #1558 Send pre-flight + slicer-surface audit bundle 2026-05-30 13:34:10 +02:00
tcp_proxy.py fix(virtual-printer): #1610 add Bambu cipher pin to every slicer-facing TLS context 2026-06-03 10:04:37 +02:00