From 024056cb7db59cf2b3f11e69686577df4147778f Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Thu, 27 Mar 2025 11:18:04 +0100 Subject: [PATCH] fix: handle Bambu connection state by introducing bambuDisabled flag --- src/bambu.cpp | 5 ++--- src/main.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bambu.cpp b/src/bambu.cpp index 4278c1e..56325a1 100644 --- a/src/bambu.cpp +++ b/src/bambu.cpp @@ -607,14 +607,13 @@ bool setupMqtt() { bool success = loadBambuCredentials(); if (!success) { - Serial.println("Failed to load Bambu credentials"); - oledShowMessage("Bambu Credentials Missing"); - vTaskDelay(2000 / portTICK_PERIOD_MS); + bambuDisabled = true; return false; } if (success && bambu_ip != "" && bambu_accesscode != "" && bambu_serialnr != "") { + bambuDisabled = false; sslClient.setCACert(root_ca); sslClient.setInsecure(); client.setServer(bambu_ip, 8883); diff --git a/src/main.cpp b/src/main.cpp index d9ead63..0b2c635 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,7 +100,7 @@ void loop() { // Wenn Bambu auto set Spool aktiv if (autoSendToBambu && autoSetToBambuSpoolId > 0) { - if (!bambu_connected) + if (!bambuDisabled && !bambu_connected) { bambu_restart(); }