feat: add updateOctoSpoolId for OctoPrint integration and change autoSetToBambuSpoolId type to uint16_t

This commit is contained in:
2025-09-02 17:36:34 +02:00
parent 100328b1d6
commit 0baa1d286e
5 changed files with 9 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ uint16_t foundVendorId = 0; // Store ID of found vendor
uint16_t foundFilamentId = 0; // Store ID of found filament uint16_t foundFilamentId = 0; // Store ID of found filament
uint16_t createdFilamentId = 0; // Store ID of newly created filament uint16_t createdFilamentId = 0; // Store ID of newly created filament
uint16_t createdSpoolId = 0; // Store ID of newly created spool uint16_t createdSpoolId = 0; // Store ID of newly created spool
uint16_t updateOctoSpoolId = 0; // Store spool ID for OctoPrint update
bool spoolmanConnected = false; bool spoolmanConnected = false;
bool spoolmanExtraFieldsChecked = false; bool spoolmanExtraFieldsChecked = false;
TaskHandle_t* apiTask; TaskHandle_t* apiTask;

View File

@@ -33,6 +33,7 @@ extern bool sendOctoUpdate;
extern String octoUrl; extern String octoUrl;
extern String octoToken; extern String octoToken;
extern bool spoolmanConnected; extern bool spoolmanConnected;
extern uint16_t updateOctoSpoolId;
bool checkSpoolmanInstance(); bool checkSpoolmanInstance();
bool saveSpoolmanUrl(const String& url, bool octoOn, const String& octoWh, const String& octoTk); bool saveSpoolmanUrl(const String& url, bool octoOn, const String& octoWh, const String& octoTk);

View File

@@ -21,7 +21,7 @@ TaskHandle_t BambuMqttTask;
bool bambuDisabled = false; bool bambuDisabled = false;
bool bambu_connected = false; bool bambu_connected = false;
int autoSetToBambuSpoolId = 0; uint16_t autoSetToBambuSpoolId = 0;
BambuCredentials bambuCredentials; BambuCredentials bambuCredentials;

View File

@@ -37,7 +37,7 @@ extern bool bambu_connected;
extern int ams_count; extern int ams_count;
extern AMSData ams_data[MAX_AMS]; extern AMSData ams_data[MAX_AMS];
//extern bool autoSendToBambu; //extern bool autoSendToBambu;
extern int autoSetToBambuSpoolId; extern uint16_t autoSetToBambuSpoolId;
extern bool bambuDisabled; extern bool bambuDisabled;
extern BambuCredentials bambuCredentials; extern BambuCredentials bambuCredentials;

View File

@@ -242,6 +242,10 @@ void loop() {
{ {
autoSetToBambuSpoolId = activeSpoolId.toInt(); autoSetToBambuSpoolId = activeSpoolId.toInt();
} }
if (octoEnabled)
{
updateOctoSpoolId = activeSpoolId.toInt();
}
} }
else else
{ {
@@ -271,7 +275,7 @@ void loop() {
if(octoEnabled && sendOctoUpdate && spoolmanApiState == API_IDLE) if(octoEnabled && sendOctoUpdate && spoolmanApiState == API_IDLE)
{ {
updateSpoolOcto(activeSpoolId.toInt()); updateSpoolOcto(updateOctoSpoolId);
sendOctoUpdate = false; sendOctoUpdate = false;
} }
} }