fix: enhance Bambu spool handling by adding tray info index and improving logging
This commit is contained in:
parent
0379c4c45f
commit
9ace9f0567
@ -405,7 +405,7 @@ function handleSpoolIn(amsId, trayId) {
|
|||||||
minTemp = selectedSpool.filament.nozzle_temperature[0];
|
minTemp = selectedSpool.filament.nozzle_temperature[0];
|
||||||
maxTemp = selectedSpool.filament.nozzle_temperature[1];
|
maxTemp = selectedSpool.filament.nozzle_temperature[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Erstelle Payload
|
// Erstelle Payload
|
||||||
const payload = {
|
const payload = {
|
||||||
type: 'setBambuSpool',
|
type: 'setBambuSpool',
|
||||||
@ -416,7 +416,8 @@ function handleSpoolIn(amsId, trayId) {
|
|||||||
nozzle_temp_min: parseInt(minTemp),
|
nozzle_temp_min: parseInt(minTemp),
|
||||||
nozzle_temp_max: parseInt(maxTemp),
|
nozzle_temp_max: parseInt(maxTemp),
|
||||||
type: selectedSpool.filament.material,
|
type: selectedSpool.filament.material,
|
||||||
brand: selectedSpool.filament.vendor.name
|
brand: selectedSpool.filament.vendor.name,
|
||||||
|
tray_info_idx: selectedSpool.filament.extra.bambu_idx.replace(/['"]+/g, '').trim()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -174,6 +174,7 @@ bool setBambuSpool(String payload) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Serial.println("Setting spool");
|
Serial.println("Setting spool");
|
||||||
|
Serial.println(payload);
|
||||||
|
|
||||||
// Parse the JSON
|
// Parse the JSON
|
||||||
JsonDocument doc;
|
JsonDocument doc;
|
||||||
@ -192,7 +193,8 @@ bool setBambuSpool(String payload) {
|
|||||||
int maxTemp = doc["nozzle_temp_max"];
|
int maxTemp = doc["nozzle_temp_max"];
|
||||||
String type = doc["type"].as<String>();
|
String type = doc["type"].as<String>();
|
||||||
String brand = doc["brand"].as<String>();
|
String brand = doc["brand"].as<String>();
|
||||||
String tray_info_idx = (brand != "" && type != "") ? findFilamentIdx(brand, type) : "";
|
String tray_info_idx = doc["tray_info_idx"].as<String>();
|
||||||
|
if (tray_info_idx == "") tray_info_idx = (brand != "" && type != "") ? findFilamentIdx(brand, type) : "";
|
||||||
|
|
||||||
doc.clear();
|
doc.clear();
|
||||||
|
|
||||||
@ -441,6 +443,8 @@ void mqtt_loop(void * parameter) {
|
|||||||
vTaskDelay(100);
|
vTaskDelay(100);
|
||||||
}
|
}
|
||||||
client.loop();
|
client.loop();
|
||||||
|
yield();
|
||||||
|
vTaskDelay(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user