Compare commits

...

10 Commits

Author SHA1 Message Date
bc51956793 docs: update changelog and header for version v2.0.0-beta5
All checks were successful
Release Workflow / detect-provider (push) Successful in 4s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m18s
2025-08-30 08:25:58 +02:00
5666a58da2 docs: update platformio.ini for beta version v2.0.0-beta5 2025-08-30 08:25:58 +02:00
a35f15eca5 fix: call scale.tare() in setup after starting scale 2025-08-30 08:25:52 +02:00
f28b34e427 docs: update changelog and header for version v2.0.0-beta4
All checks were successful
Release Workflow / detect-provider (push) Successful in 9s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m4s
2025-08-29 18:57:42 +02:00
9215560558 docs: update platformio.ini for beta version v2.0.0-beta4 2025-08-29 18:57:41 +02:00
7f6bce1699 fix: update createVendor function to use external_id as comment instead of static text 2025-08-29 18:56:20 +02:00
2a4f8bb679 fix: update to_old_version in platformio.ini to reflect correct previous version 2025-08-29 18:45:16 +02:00
480e2da23e docs: update changelog and header for version v2.0.0-beta3
All checks were successful
Release Workflow / detect-provider (push) Successful in 3s
Release Workflow / github-release (push) Has been skipped
Release Workflow / gitea-release (push) Successful in 3m13s
2025-08-29 18:44:33 +02:00
ba22602767 docs: update platformio.ini for beta version v2.0.0-beta3 2025-08-29 18:44:33 +02:00
b2c68d5aac refactor: update createVendor and checkVendor functions to accept JsonDocument payload 2025-08-29 18:44:21 +02:00
5 changed files with 52 additions and 13 deletions

View File

@@ -1,5 +1,28 @@
# Changelog # Changelog
## [2.0.0-beta5] - 2025-08-30
### Changed
- update platformio.ini for beta version v2.0.0-beta5
### Fixed
- call scale.tare() in setup after starting scale
## [2.0.0-beta4] - 2025-08-29
### Changed
- update platformio.ini for beta version v2.0.0-beta4
### Fixed
- update createVendor function to use external_id as comment instead of static text
- update to_old_version in platformio.ini to reflect correct previous version
## [2.0.0-beta3] - 2025-08-29
### Changed
- update platformio.ini for beta version v2.0.0-beta3
- update createVendor and checkVendor functions to accept JsonDocument payload
## [2.0.0-beta2] - 2025-08-29 ## [2.0.0-beta2] - 2025-08-29
### Added ### Added
- add Manufacturer Tags support documentation in German and English - add Manufacturer Tags support documentation in German and English

View File

@@ -9,8 +9,8 @@
; https://docs.platformio.org/page/projectconf.html ; https://docs.platformio.org/page/projectconf.html
[common] [common]
version = "2.0.0-beta2" version = "2.0.0-beta5"
to_old_version = "2.0.0" to_old_version = "1.5.10"
## ##
[env:esp32dev] [env:esp32dev]

View File

@@ -603,7 +603,7 @@ bool updateSpoolBambuData(String payload) {
} }
// #### Brand Filament // #### Brand Filament
uint16_t createVendor(String vendor) { uint16_t createVendor(const JsonDocument& payload) {
oledShowProgressBar(2, 5, "New Brand", "Create new Vendor"); oledShowProgressBar(2, 5, "New Brand", "Create new Vendor");
// Create new vendor in Spoolman database using task system // Create new vendor in Spoolman database using task system
@@ -617,9 +617,24 @@ uint16_t createVendor(String vendor) {
// Create JSON payload for vendor creation // Create JSON payload for vendor creation
JsonDocument vendorDoc; JsonDocument vendorDoc;
vendorDoc["name"] = vendor; vendorDoc["name"] = payload["b"].as<String>();
vendorDoc["comment"] = "automatically generated";
vendorDoc["external_id"] = vendor; // Extract domain from URL if present, otherwise use brand name
String externalId = "";
if (payload["u"].is<String>()) {
String url = payload["u"].as<String>();
// Extract domain from URL (e.g., "https://www.blubb.de/f1234/?suche=irgendwas" -> "https://www.blubb.de")
int protocolEnd = url.indexOf("://");
if (protocolEnd != -1) {
int pathStart = url.indexOf("/", protocolEnd + 3);
externalId = (pathStart != -1) ? url.substring(0, pathStart) : url;
} else {
externalId = url; // No protocol found, use as is
}
} else {
externalId = payload["b"].as<String>();
}
vendorDoc["comment"] = externalId;
String vendorPayload; String vendorPayload;
serializeJson(vendorDoc, vendorPayload); serializeJson(vendorDoc, vendorPayload);
@@ -668,13 +683,13 @@ uint16_t createVendor(String vendor) {
return createdVendorId; return createdVendorId;
} }
uint16_t checkVendor(String vendor) { uint16_t checkVendor(const JsonDocument& payload) {
oledShowProgressBar(1, 5, "New Brand", "Check Vendor"); oledShowProgressBar(1, 5, "New Brand", "Check Vendor");
// Check if vendor exists using task system // Check if vendor exists using task system
foundVendorId = 65535; // Reset to invalid value to detect when API response is received foundVendorId = 65535; // Reset to invalid value to detect when API response is received
String vendorName = vendor; String vendorName = payload["b"].as<String>();
vendorName.trim(); vendorName.trim();
vendorName.replace(" ", "+"); vendorName.replace(" ", "+");
String spoolsUrl = spoolmanUrl + apiUrl + "/vendor?name=" + vendorName; String spoolsUrl = spoolmanUrl + apiUrl + "/vendor?name=" + vendorName;
@@ -716,7 +731,7 @@ uint16_t checkVendor(String vendor) {
// Check if vendor was found // Check if vendor was found
if (foundVendorId == 0) { if (foundVendorId == 0) {
Serial.println("Vendor not found, creating new vendor..."); Serial.println("Vendor not found, creating new vendor...");
uint16_t vendorId = createVendor(vendor); uint16_t vendorId = createVendor(payload);
if (vendorId == 0) { if (vendorId == 0) {
Serial.println("Failed to create vendor, returning 0."); Serial.println("Failed to create vendor, returning 0.");
return 0; // Failed to create vendor return 0; // Failed to create vendor
@@ -725,7 +740,7 @@ uint16_t checkVendor(String vendor) {
return vendorId; return vendorId;
} }
} else { } else {
Serial.println("Vendor found: " + vendor); Serial.println("Vendor found: " + payload["b"].as<String>());
Serial.print("Vendor ID: "); Serial.print("Vendor ID: ");
Serial.println(foundVendorId); Serial.println(foundVendorId);
return foundVendorId; return foundVendorId;
@@ -966,7 +981,7 @@ uint16_t createSpool(uint16_t vendorId, uint16_t filamentId, JsonDocument& paylo
} }
bool createBrandFilament(JsonDocument& payload, String uidString) { bool createBrandFilament(JsonDocument& payload, String uidString) {
uint16_t vendorId = checkVendor(payload["b"].as<String>()); uint16_t vendorId = checkVendor(payload);
if (vendorId == 0) { if (vendorId == 0) {
Serial.println("ERROR: Failed to create/find vendor"); Serial.println("ERROR: Failed to create/find vendor");
return false; return false;

View File

@@ -59,6 +59,7 @@ void setup() {
// Scale // Scale
start_scale(touchSensorConnected); start_scale(touchSensorConnected);
scale.tare();
// WDT initialisieren mit 10 Sekunden Timeout // WDT initialisieren mit 10 Sekunden Timeout
bool panic = true; // Wenn true, löst ein WDT-Timeout einen System-Panik aus bool panic = true; // Wenn true, löst ein WDT-Timeout einen System-Panik aus

View File

@@ -122,8 +122,8 @@ void start_scale(bool touchSensorConnected) {
} }
scale.set_scale(calibrationValue); scale.set_scale(calibrationValue);
vTaskDelay(pdMS_TO_TICKS(5000)); //vTaskDelay(pdMS_TO_TICKS(5000));
scale.tare(); //scale.tare();
// Display Gewicht // Display Gewicht
oledShowWeight(0); oledShowWeight(0);