Compare commits
	
		
			12 Commits
		
	
	
		
			v2.0.0-bet
			...
			d5d7358f58
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d5d7358f58 | |||
| 9b362b3c73 | |||
| bc51956793 | |||
| 5666a58da2 | |||
| a35f15eca5 | |||
| f28b34e427 | |||
| 9215560558 | |||
| 7f6bce1699 | |||
| 2a4f8bb679 | |||
| 480e2da23e | |||
| ba22602767 | |||
| b2c68d5aac | 
							
								
								
									
										23
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								CHANGELOG.md
									
									
									
									
									
								
							@@ -1,5 +1,28 @@
 | 
			
		||||
# 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
 | 
			
		||||
### Added
 | 
			
		||||
- add Manufacturer Tags support documentation in German and English
 | 
			
		||||
 
 | 
			
		||||
@@ -9,8 +9,8 @@
 | 
			
		||||
; https://docs.platformio.org/page/projectconf.html
 | 
			
		||||
 | 
			
		||||
[common]
 | 
			
		||||
version = "2.0.0-beta2"
 | 
			
		||||
to_old_version = "2.0.0"
 | 
			
		||||
version = "2.0.0-beta5"
 | 
			
		||||
to_old_version = "1.5.10"
 | 
			
		||||
 | 
			
		||||
##
 | 
			
		||||
[env:esp32dev]
 | 
			
		||||
 
 | 
			
		||||
@@ -14,17 +14,39 @@ def get_version():
 | 
			
		||||
        return version_match.group(1) if version_match else None
 | 
			
		||||
 | 
			
		||||
def get_last_tag():
 | 
			
		||||
    """Get the last non-beta tag for changelog generation"""
 | 
			
		||||
    try:
 | 
			
		||||
        result = subprocess.run(['git', 'describe', '--tags', '--abbrev=0'], 
 | 
			
		||||
        # Get all tags sorted by version
 | 
			
		||||
        result = subprocess.run(['git', 'tag', '-l', '--sort=-version:refname'], 
 | 
			
		||||
                              capture_output=True, text=True)
 | 
			
		||||
        return result.stdout.strip()
 | 
			
		||||
        if result.returncode != 0:
 | 
			
		||||
            return None
 | 
			
		||||
            
 | 
			
		||||
        tags = result.stdout.strip().split('\n')
 | 
			
		||||
        
 | 
			
		||||
        # Find the first (newest) non-beta tag
 | 
			
		||||
        for tag in tags:
 | 
			
		||||
            if tag and not '-beta' in tag.lower():
 | 
			
		||||
                print(f"Using last stable tag for changelog: {tag}")
 | 
			
		||||
                return tag
 | 
			
		||||
        
 | 
			
		||||
        # Fallback: if no non-beta tags found, use the newest tag
 | 
			
		||||
        print("No stable tags found, using newest tag")
 | 
			
		||||
        if tags and tags[0]:
 | 
			
		||||
            return tags[0]
 | 
			
		||||
        return None
 | 
			
		||||
    except subprocess.CalledProcessError:
 | 
			
		||||
        return None
 | 
			
		||||
 | 
			
		||||
def categorize_commit(commit_msg):
 | 
			
		||||
    """Categorize commit messages based on conventional commits"""
 | 
			
		||||
    lower_msg = commit_msg.lower()
 | 
			
		||||
    if any(x in lower_msg for x in ['feat', 'add', 'new']):
 | 
			
		||||
    
 | 
			
		||||
    # Check for breaking changes first
 | 
			
		||||
    if ('!' in commit_msg and any(x in lower_msg for x in ['feat!', 'fix!', 'chore!', 'refactor!'])) or \
 | 
			
		||||
       'breaking change' in lower_msg or 'breaking:' in lower_msg:
 | 
			
		||||
        return 'Breaking Changes'
 | 
			
		||||
    elif any(x in lower_msg for x in ['feat', 'add', 'new']):
 | 
			
		||||
        return 'Added'
 | 
			
		||||
    elif any(x in lower_msg for x in ['fix', 'bug']):
 | 
			
		||||
        return 'Fixed'
 | 
			
		||||
@@ -34,6 +56,7 @@ def categorize_commit(commit_msg):
 | 
			
		||||
def get_changes_from_git():
 | 
			
		||||
    """Get changes from git commits since last tag"""
 | 
			
		||||
    changes = {
 | 
			
		||||
        'Breaking Changes': [],
 | 
			
		||||
        'Added': [],
 | 
			
		||||
        'Changed': [],
 | 
			
		||||
        'Fixed': []
 | 
			
		||||
@@ -55,7 +78,9 @@ def get_changes_from_git():
 | 
			
		||||
            if commit:
 | 
			
		||||
                category = categorize_commit(commit)
 | 
			
		||||
                # Clean up commit message
 | 
			
		||||
                clean_msg = re.sub(r'^(feat|fix|chore|docs|style|refactor|perf|test)(\(.*\))?:', '', commit).strip()
 | 
			
		||||
                clean_msg = re.sub(r'^(feat|fix|chore|docs|style|refactor|perf|test)(\(.*\))?!?:', '', commit).strip()
 | 
			
		||||
                # Remove BREAKING CHANGE prefix if present
 | 
			
		||||
                clean_msg = re.sub(r'^breaking change:\s*', '', clean_msg, flags=re.IGNORECASE).strip()
 | 
			
		||||
                changes[category].append(clean_msg)
 | 
			
		||||
                
 | 
			
		||||
    except subprocess.CalledProcessError:
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										33
									
								
								src/api.cpp
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								src/api.cpp
									
									
									
									
									
								
							@@ -603,7 +603,7 @@ bool updateSpoolBambuData(String payload) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// #### Brand Filament
 | 
			
		||||
uint16_t createVendor(String vendor) {
 | 
			
		||||
uint16_t createVendor(const JsonDocument& payload) {
 | 
			
		||||
    oledShowProgressBar(2, 5, "New Brand", "Create new Vendor");
 | 
			
		||||
 | 
			
		||||
    // Create new vendor in Spoolman database using task system
 | 
			
		||||
@@ -617,9 +617,24 @@ uint16_t createVendor(String vendor) {
 | 
			
		||||
 | 
			
		||||
    // Create JSON payload for vendor creation
 | 
			
		||||
    JsonDocument vendorDoc;
 | 
			
		||||
    vendorDoc["name"] = vendor;
 | 
			
		||||
    vendorDoc["comment"] = "automatically generated";
 | 
			
		||||
    vendorDoc["external_id"] = vendor;
 | 
			
		||||
    vendorDoc["name"] = payload["b"].as<String>();
 | 
			
		||||
    
 | 
			
		||||
    // 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;
 | 
			
		||||
    serializeJson(vendorDoc, vendorPayload);
 | 
			
		||||
@@ -668,13 +683,13 @@ uint16_t createVendor(String vendor) {
 | 
			
		||||
    return createdVendorId;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint16_t checkVendor(String vendor) {
 | 
			
		||||
uint16_t checkVendor(const JsonDocument& payload) {
 | 
			
		||||
    oledShowProgressBar(1, 5, "New Brand", "Check Vendor");
 | 
			
		||||
 | 
			
		||||
    // Check if vendor exists using task system
 | 
			
		||||
    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.replace(" ", "+");
 | 
			
		||||
    String spoolsUrl = spoolmanUrl + apiUrl + "/vendor?name=" + vendorName;
 | 
			
		||||
@@ -716,7 +731,7 @@ uint16_t checkVendor(String vendor) {
 | 
			
		||||
    // Check if vendor was found
 | 
			
		||||
    if (foundVendorId == 0) {
 | 
			
		||||
        Serial.println("Vendor not found, creating new vendor...");
 | 
			
		||||
        uint16_t vendorId = createVendor(vendor);
 | 
			
		||||
        uint16_t vendorId = createVendor(payload);
 | 
			
		||||
        if (vendorId == 0) {
 | 
			
		||||
            Serial.println("Failed to create vendor, returning 0.");
 | 
			
		||||
            return 0; // Failed to create vendor
 | 
			
		||||
@@ -725,7 +740,7 @@ uint16_t checkVendor(String vendor) {
 | 
			
		||||
            return vendorId;
 | 
			
		||||
        }
 | 
			
		||||
    } else {
 | 
			
		||||
        Serial.println("Vendor found: " + vendor);
 | 
			
		||||
        Serial.println("Vendor found: " + payload["b"].as<String>());
 | 
			
		||||
        Serial.print("Vendor ID: ");
 | 
			
		||||
        Serial.println(foundVendorId);
 | 
			
		||||
        return foundVendorId;
 | 
			
		||||
@@ -966,7 +981,7 @@ uint16_t createSpool(uint16_t vendorId, uint16_t filamentId, JsonDocument& paylo
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool createBrandFilament(JsonDocument& payload, String uidString) {
 | 
			
		||||
    uint16_t vendorId = checkVendor(payload["b"].as<String>());
 | 
			
		||||
    uint16_t vendorId = checkVendor(payload);
 | 
			
		||||
    if (vendorId == 0) {
 | 
			
		||||
        Serial.println("ERROR: Failed to create/find vendor");
 | 
			
		||||
        return false;
 | 
			
		||||
 
 | 
			
		||||
@@ -59,6 +59,7 @@ void setup() {
 | 
			
		||||
 | 
			
		||||
  // Scale
 | 
			
		||||
  start_scale(touchSensorConnected);
 | 
			
		||||
  scale.tare();
 | 
			
		||||
 | 
			
		||||
  // WDT initialisieren mit 10 Sekunden Timeout
 | 
			
		||||
  bool panic = true; // Wenn true, löst ein WDT-Timeout einen System-Panik aus
 | 
			
		||||
 
 | 
			
		||||
@@ -122,8 +122,8 @@ void start_scale(bool touchSensorConnected) {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  scale.set_scale(calibrationValue);
 | 
			
		||||
  vTaskDelay(pdMS_TO_TICKS(5000));
 | 
			
		||||
  scale.tare();
 | 
			
		||||
  //vTaskDelay(pdMS_TO_TICKS(5000));
 | 
			
		||||
  //scale.tare();
 | 
			
		||||
 | 
			
		||||
  // Display Gewicht
 | 
			
		||||
  oledShowWeight(0);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user