fix: handle Bambu connection state by introducing bambuDisabled flag

This commit is contained in:
Manuel Weiser 2025-03-27 11:18:04 +01:00
parent e040a736b0
commit 024056cb7d
2 changed files with 3 additions and 4 deletions

View File

@ -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);

View File

@ -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();
}