mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-05-09 05:35:30 +02:00
[PR #892] [MERGED] Add Load/Unload filament buttons to printer controls #1127
Labels
No labels
A1
automated
automated
bug
bug
Closed due to inactivity
contrib
dependencies
dependencies
duplicate
enhancement
feedback
hold
invalid
Notes
P1S
pull-request
security
security
ThumbsUp
user-report
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/bambuddy#1127
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/maziggy/bambuddy/pull/892
Author: @NNeerr00
Created: 4/4/2026
Status: ✅ Merged
Merged: 4/5/2026
Merged by: @maziggy
Base:
dev← Head:dev📝 Commits (1)
e3cde14Add Load/Unload External filament buttons to printer controls📊 Changes
11 files changed (+242 additions, -1 deletions)
View changed files
📝
backend/app/api/routes/printers.py(+46 -0)📝
backend/app/services/bambu_mqtt.py(+88 -0)📝
frontend/src/api/client.ts(+8 -0)📝
frontend/src/i18n/locales/de.ts(+6 -0)📝
frontend/src/i18n/locales/en.ts(+6 -0)📝
frontend/src/i18n/locales/fr.ts(+6 -0)📝
frontend/src/i18n/locales/it.ts(+6 -0)📝
frontend/src/i18n/locales/ja.ts(+6 -0)📝
frontend/src/i18n/locales/pt-BR.ts(+6 -0)📝
frontend/src/i18n/locales/zh-CN.ts(+6 -0)📝
frontend/src/pages/PrintersPage.tsx(+58 -1)📄 Description
CAUTION: THIS IMPLEMENTATION HAS BEEN HEAVILY ASSITED BY AI!
Tested on my own setup: P1S, P1P, With and Without AMS
Closes #891
Description
New dedicated MQTT methods, API endpoints, and UI buttons for loading/unloading filament. Includes state guards to prevent load when filament is already loaded and unload when nothing is loaded.
Type of Change
Changes Made
Backend
backend/app/services/bambu_mqtt.pyload_external_filament() -> tuple[bool, str]— sendsams_change_filamentwithams_id=255, slot_id=254, target=254.Refuses if filament is already loaded (
tray_now != 255).unload_external_filament() -> tuple[bool, str]— sendsams_change_filamentwithams_id=255, slot_id=255, target=255.Refuses if nothing is loaded (
tray_now == 255). Uses currentnozzle temp (defaults to 210 if cold).
backend/app/api/routes/printers.pyPOST /{printer_id}/filament/load-external— permissionPRINTERS_CONTROL, callsclient.load_external_filament().POST /{printer_id}/filament/unload-external— permissionPRINTERS_CONTROL, callsclient.unload_external_filament().Frontend
frontend/src/api/client.tsloadExternalFilament(printerId)andunloadExternalFilament(printerId)API methods.frontend/src/pages/PrintersPage.tsxArrowDownToLine,ArrowUpFromLinefrom lucide-react.loadExternalMutationandunloadExternalMutation(samepattern as stop/pause/resume).
isControlBusycheck.left-aligned. Disabled when printing, offline, busy, or missing
permission. Spinner on pending.
i18n (all 7 locales)
en.ts,de.ts,ja.ts,it.ts,fr.ts,pt-BR.ts,zh-CN.tsloadExternal/unloadExternalbutton labels ("Load" /"Unload").
filamentLoadExternalSent,filamentUnloadExternalSent,failedToLoadExternalFilament,failedToUnloadExternalFilament.Testing
Checklist
Additional Notes
CAUTION: THIS IMPLEMENTATION HAS BEEN HEAVILY ASSITED BY AI! AND SHOULD BE CHECKED? I GUESS
Its working for me currenty. I hope it will be a good basis to build on
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.