From 6502bb7185c26d11e6657a3f47312726567d174b Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Sat, 30 Aug 2025 11:08:56 +0200 Subject: [PATCH] feat: add handling for successful NFC tag writes to send weight to Spoolman without auto-sending to Bambu --- src/main.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 16fa7ba..c63945a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -250,6 +250,25 @@ void loop() { } } + // Handle successful tag write: Send weight to Spoolman but NEVER auto-send to Bambu + if (activeSpoolId != "" && weigthCouterToApi > 3 && weightSend == 0 && nfcReaderState == NFC_WRITE_SUCCESS && tagProcessed == false && spoolmanApiState == API_IDLE) + { + // set the current tag as processed to prevent it beeing processed again + tagProcessed = true; + + if (updateSpoolWeight(activeSpoolId, weight)) + { + weightSend = 1; + Serial.println("Tag written: Weight sent to Spoolman, but NO auto-send to Bambu"); + // INTENTIONALLY do NOT set autoSetToBambuSpoolId here to prevent Bambu auto-send + } + else + { + oledShowIcon("failed"); + vTaskDelay(2000 / portTICK_PERIOD_MS); + } + } + if(octoEnabled && sendOctoUpdate && spoolmanApiState == API_IDLE) { updateSpoolOcto(autoSetToBambuSpoolId);