1
0
Fork 0
mirror of https://github.com/maziggy/bambuddy.git synced 2026-05-09 08:25:54 +02:00

[PR #719] [MERGED] [Fix]: Send Bambu RFID Tags to Spoolman, Allow Unlink in Manual Mode, Stop Location Clearing for Generic Spools #1106

Closed
opened 2026-05-07 00:16:02 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/maziggy/bambuddy/pull/719
Author: @shrunbr
Created: 3/15/2026
Status: Merged
Merged: 3/16/2026
Merged by: @maziggy

Base: devHead: fix/spoolmanManualMode


📝 Commits (9)

  • 84d934d Prefers trayUuid over tagUid for using Bambu spool ID in Spoolman vs generated ID needed for generic spools
  • 9f1681c Fetches Spoolman sync mode from backend, passes to FilamentHoverCard
  • 2de612f Uses Spoolman sync mode, if manual, will now show unlink spool button for Bambu Lab spools
  • b8cf778 Checks for 32-character tags before clearing location of spools so that only Bambu lab spool locations are cleared on sync since generic spools are skipped
  • dd40b48 Adds spool link test for linking bambu spools, modifies existing test to be for generic spools
  • 5535c5f Updates spool tags in clear location test to be 32-chars to reflect new requirement to clear location
  • 198bc29 Use constant for Bambu RFID tag length
  • f898717 Merge branch 'dev' into fix/spoolmanManualMode
  • 5670da0 Merge branch 'dev' into fix/spoolmanManualMode

📊 Changes

6 files changed (+56 additions, -11 deletions)

View changed files

📝 backend/app/services/spoolman.py (+5 -0)
📝 backend/tests/unit/services/test_spoolman_service.py (+8 -4)
📝 frontend/src/__tests__/components/LinkSpoolModal.test.tsx (+20 -1)
📝 frontend/src/components/FilamentHoverCard.tsx (+2 -1)
📝 frontend/src/components/LinkSpoolModal.tsx (+4 -4)
📝 frontend/src/pages/PrintersPage.tsx (+17 -1)

📄 Description

Description

This PR has trayUuid take precedence over tagUid so that the Bambu spool RFID is sent to Spoolman and not the generic placeholder needed for generic spools. While fixing this, it became clear to me that if someone were running sync in manual mode they may want the ability to unlink Bambu spools from Spoolman themselves so the button now appears on Bambu spools but only if Spoolman is in Manual mode.

After testing sync in manual mode, I noticed that even though Bambuddy said it was skipping non-Bambu spools it would clear the location from non-Bambu spools in Spoolman. To fix that, we now look for the 32-char tag on the spool before clearing it since the generic ones we generate are 16-chars. Now generic spool locations are not cleared from Spoolman upon sync, they are truly skipped.

COPILOT GENERATED SUMMARY
This pull request improves the handling of Bambu Lab spools and their integration with Spoolman, focusing on more accurate identification of spools using tray UUIDs, better sync mode awareness, and clearer logic for linking/unlinking spools. It also updates the UI and tests to reflect these changes.

Fixes #714

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Changes Made

Backend: Bambu Lab Spool Handling

  • The backend now only clears locations for removed spools if they are Bambu Lab spools, identified by a 32-character RFID tag, ensuring generic spools are not affected.
  • Unit tests for clearing locations have been updated to use realistic 32-character tags, improving test accuracy for Bambu Lab spool scenarios.

Frontend: Spool Linking and Unlinking Logic

  • The logic for linking spools in LinkSpoolModal now prioritizes trayUuid (Bambu Lab path) over tagUid (generic path), ensuring the correct identifier is used for Bambu Lab spools.
  • The FilamentHoverCard and related UI now conditionally show the unlink option based on the sync mode, hiding it for Bambu Lab spools when auto-sync is enabled.
  • The PrintersPage and PrinterCard components now fetch and propagate Spoolman sync mode settings, enabling context-aware UI behavior for linking and unlinking spools.
  • The LinkSpoolModal tests have been expanded to cover both Bambu Lab (trayUuid present) and generic (trayUuid missing) linking paths, ensuring correct behavior in both scenarios.

Screenshots

Unlink button on a Bambu spool while in Manual sync mode
image

Bambu Lab RFID tags showing when available
image

Generic tags showing when RFID tags are not available
image

RFID tag in Spoolman
image

Testing

  • I have tested this on my local machine
  • I have tested with my printer model:

Checklist

  • My code follows the project's coding style
  • I have commented my code where necessary
  • I have updated the documentation (if needed)
  • My changes generate no new warnings
  • I have tested my changes thoroughly

Additional Notes


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/maziggy/bambuddy/pull/719 **Author:** [@shrunbr](https://github.com/shrunbr) **Created:** 3/15/2026 **Status:** ✅ Merged **Merged:** 3/16/2026 **Merged by:** [@maziggy](https://github.com/maziggy) **Base:** `dev` ← **Head:** `fix/spoolmanManualMode` --- ### 📝 Commits (9) - [`84d934d`](https://github.com/maziggy/bambuddy/commit/84d934d52b86993ea7aff13a5179ab8c9792ead5) Prefers trayUuid over tagUid for using Bambu spool ID in Spoolman vs generated ID needed for generic spools - [`9f1681c`](https://github.com/maziggy/bambuddy/commit/9f1681c8d8f8e73ae859ccf2b2929b0159c0362f) Fetches Spoolman sync mode from backend, passes to FilamentHoverCard - [`2de612f`](https://github.com/maziggy/bambuddy/commit/2de612f5666e5678f81c7590a60df6ac9a1b6afe) Uses Spoolman sync mode, if manual, will now show unlink spool button for Bambu Lab spools - [`b8cf778`](https://github.com/maziggy/bambuddy/commit/b8cf778a2ba14bb4b0a096d8b76f1439c905a22f) Checks for 32-character tags before clearing location of spools so that only Bambu lab spool locations are cleared on sync since generic spools are skipped - [`dd40b48`](https://github.com/maziggy/bambuddy/commit/dd40b489f8f1e4b9d57ba8834635963f6cf4d501) Adds spool link test for linking bambu spools, modifies existing test to be for generic spools - [`5535c5f`](https://github.com/maziggy/bambuddy/commit/5535c5f5ca39ea05d30be4a23f3d42e7adbc20ff) Updates spool tags in clear location test to be 32-chars to reflect new requirement to clear location - [`198bc29`](https://github.com/maziggy/bambuddy/commit/198bc2927c50bb185a987cf4e5441847f58403f0) Use constant for Bambu RFID tag length - [`f898717`](https://github.com/maziggy/bambuddy/commit/f898717043875326a1edfe708ea6e3f204562427) Merge branch 'dev' into fix/spoolmanManualMode - [`5670da0`](https://github.com/maziggy/bambuddy/commit/5670da002756cea118daeab21d2b547269845a58) Merge branch 'dev' into fix/spoolmanManualMode ### 📊 Changes **6 files changed** (+56 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `backend/app/services/spoolman.py` (+5 -0) 📝 `backend/tests/unit/services/test_spoolman_service.py` (+8 -4) 📝 `frontend/src/__tests__/components/LinkSpoolModal.test.tsx` (+20 -1) 📝 `frontend/src/components/FilamentHoverCard.tsx` (+2 -1) 📝 `frontend/src/components/LinkSpoolModal.tsx` (+4 -4) 📝 `frontend/src/pages/PrintersPage.tsx` (+17 -1) </details> ### 📄 Description ## Description This PR has trayUuid take precedence over tagUid so that the Bambu spool RFID is sent to Spoolman and not the generic placeholder needed for generic spools. While fixing this, it became clear to me that if someone were running sync in manual mode they may want the ability to unlink Bambu spools from Spoolman themselves so the button now appears on Bambu spools but only if Spoolman is in Manual mode. After testing sync in manual mode, I noticed that even though Bambuddy said it was skipping non-Bambu spools it would clear the location from non-Bambu spools in Spoolman. To fix that, we now look for the 32-char tag on the spool before clearing it since the generic ones we generate are 16-chars. Now generic spool locations are not cleared from Spoolman upon sync, they are truly skipped. **COPILOT GENERATED SUMMARY** This pull request improves the handling of Bambu Lab spools and their integration with Spoolman, focusing on more accurate identification of spools using tray UUIDs, better sync mode awareness, and clearer logic for linking/unlinking spools. It also updates the UI and tests to reflect these changes. ## Related Issue <!-- Link to the issue this PR addresses (if applicable) --> Fixes #714 ## Type of Change <!-- Mark the relevant option with an "x" --> - [X] Bug fix (non-breaking change that fixes an issue) - [X] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [X] Test addition or update ## Changes Made ### Backend: Bambu Lab Spool Handling * The backend now only clears locations for removed spools if they are Bambu Lab spools, identified by a 32-character RFID tag, ensuring generic spools are not affected. * Unit tests for clearing locations have been updated to use realistic 32-character tags, improving test accuracy for Bambu Lab spool scenarios. ### Frontend: Spool Linking and Unlinking Logic * The logic for linking spools in `LinkSpoolModal` now prioritizes `trayUuid` (Bambu Lab path) over `tagUid` (generic path), ensuring the correct identifier is used for Bambu Lab spools. * The `FilamentHoverCard` and related UI now conditionally show the unlink option based on the sync mode, hiding it for Bambu Lab spools when auto-sync is enabled. * The `PrintersPage` and `PrinterCard` components now fetch and propagate Spoolman sync mode settings, enabling context-aware UI behavior for linking and unlinking spools. * The `LinkSpoolModal` tests have been expanded to cover both Bambu Lab (trayUuid present) and generic (trayUuid missing) linking paths, ensuring correct behavior in both scenarios. ## Screenshots Unlink button on a Bambu spool while in Manual sync mode <img width="221" height="306" alt="image" src="https://github.com/user-attachments/assets/8ba89953-e0da-4da7-93d8-0af80ed1a681" /> Bambu Lab RFID tags showing when available <img width="440" height="299" alt="image" src="https://github.com/user-attachments/assets/d427e999-47a5-469f-af02-b74857c535e9" /> Generic tags showing when RFID tags are not available <img width="440" height="365" alt="image" src="https://github.com/user-attachments/assets/bcd5fe5c-6615-4e4f-ba30-5037a778e968" /> RFID tag in Spoolman <img width="286" height="121" alt="image" src="https://github.com/user-attachments/assets/0429067b-623b-4c51-ad32-4f389e10c020" /> ## Testing - [X] I have tested this on my local machine - [X] I have tested with my printer model: <!-- e.g., X1C, P1S, A1 --> ## Checklist - [X] My code follows the project's coding style - [X] I have commented my code where necessary - [X] I have updated the documentation (if needed) - [X] My changes generate no new warnings - [X] I have tested my changes thoroughly ## Additional Notes <!-- Add any additional information that reviewers should know --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 00:16:02 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy-maziggy-1#1106
No description provided.