Commit Graph
1107 Commits
Author SHA1 Message Date
maziggy e6e62f2a68 Add spool inventory: AMS slot assignment, usage tracking, and remaining weight editing
Built-in spool inventory with AMS slot assignment for non-BL spools,
automatic filament usage tracking via 3MF estimates, and remaining
weight editing in the spool form.

Inventory features:
- AMS slot assignment: assign/unassign manual spools to AMS tray slots
- Filter out Bambu Lab spools (RFID-managed) from assignment modal
- Filter out already-assigned spools (one spool per slot)
- Auto-unlink manual assignments when a BL spool is inserted
- Hide assign/unassign UI on BL-occupied slots
- Case-insensitive fingerprint matching for auto-unlink logic

Usage tracking:
- 3MF-based filament consumption tracking for non-BL spools
- Extract per-filament used_g from archived 3MF slice_info
- Map 3MF slot_id to AMS (ams_id, tray_id) positions
- Scale estimates by print progress for failed/aborted prints
- Skip BL spools (tracked via AMS remain% delta, Path 1)
- Prevent double-counting with handled_trays set

Other:
- Add remaining weight field to spool edit form
- Fix hardcoded "Empty" string in AssignSpoolModal (now i18n)
- Add backend unit tests for usage_tracker (11 tests)
- Add frontend tests for AssignSpoolModal filters (5 tests)
- Update CHANGELOG, README, wiki docs, and website
2026-02-12 15:42:27 +01:00
maziggy 1f0931e00c Sync 2026-02-12 11:54:50 +01:00
maziggy ec82092bc7 Sync 2026-02-12 07:07:50 +01:00
maziggy 778d1966af Move email settings under Authentication tab in settings
Rename the "Users" settings tab to "Authentication" and move the
standalone "Global Email" tab into it as an "Email Authentication"
sub-tab. This groups email/SMTP configuration with user management
where it logically belongs.

- Remove top-level email tab from settings tab bar
- Add sub-tab navigation (Users / Email Authentication) inside the
  Authentication tab
- Handle legacy ?tab=email URLs by mapping to users tab + email sub-tab
- Update i18n keys in en/de/ja locales
2026-02-11 08:43:40 +01:00
MartinNYHC 4e75703018 Merge pull request #331 from bnap00/feature/currency-symbol-prefix
Implement currency symbol handling and update related components
2026-02-11 08:26:23 +01:00
maziggy 71560b7634 Merge origin/0.2.0b, resolve conflict keeping SUPPORTED_CURRENCIES.map() 2026-02-11 08:23:40 +01:00
maziggy 3c0c499524 Add 14 additional currency options (KRW, SEK, NOK, DKK, PLN, BRL, TWD, SGD, NZD, MXN, CZK, THB, ZAR, TRY) 2026-02-11 08:17:49 +01:00
Bharat Parsiya f5d9c4a1db Adjust padding for input fields to accommodate currency symbol length 2026-02-11 12:31:09 +05:30
maziggy 8e09e4fb65 Add additional currency options for cost tracking (#329)
Added HKD, INR, KRW, SEK, NOK, DKK, PLN, BRL, TWD, SGD, NZD, MXN,
CZK, THB, and ZAR to the currency dropdown in settings.
2026-02-11 07:51:20 +01:00
maziggy 253bee18a1 Fix nozzle rack text unreadable on light filament colors (#300)
Nozzle rack slots use the filament color as background, but light
colors (white, beige) made the white "0.4" text nearly invisible.
Added a luminance check to switch to dark text on light backgrounds
and removed the dark text shadow when not needed.
2026-02-11 07:38:57 +01:00
maziggy 0fe2bb1342 Fix timelapse baseline race condition (#315)
The snapshot-diff timelapse detection captured its baseline of existing
MP4 files at print completion time inside a background task. Fast-
encoding printers could finish writing the timelapse before the baseline
was taken, so the new file appeared in the baseline and was never
detected as "new" — resulting in no timelapse attached.

Move baseline capture to print start time, when the timelapse file
cannot possibly exist yet. The baseline is stored in a module-level dict
keyed by printer_id and popped at completion time. Falls back to
completion-time baseline if the app was restarted mid-print.
2026-02-11 07:33:07 +01:00
maziggy 09d8e7d682 Fix external camera not used for snapshot + stream dropping (#325)
The snapshot endpoint always used the internal printer camera even when
an external camera was configured. Now checks for external camera first,
matching the stream endpoint pattern. Also added retry logic (3 attempts,
2s delay) to MJPEG and RTSP stream generators so they reconnect on
timeout instead of silently ending the stream.
2026-02-11 07:09:39 +01:00
MartinNYHC 0e6f4cc694 Merge pull request #330 from jeffsf/fix/ext-cam-print-2026-02
Remove print() debugging from external_camera.py
2026-02-11 06:52:50 +01:00
MartinNYHC 8570e10f05 Merge branch '0.2.0b' into fix/ext-cam-print-2026-02 2026-02-11 06:52:34 +01:00
Bharat Parsiya ced51e06fb Implement currency symbol handling and update related components 2026-02-11 10:26:18 +05:30
Jeff Kletsky 40f4e60f04 Remove print() debugging from external_camera.py
There were several instances where print() debugging was used instead of
or in addition to formal logging. These messages were tagged `[EXT-CAM]`.

Where there was already a logging call, the print statement was removed.
Where there was not, logger.debug() was used as a replacement.

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
2026-02-10 18:55:05 -08:00
maziggy 905e609e19 Bumped version 2026-02-10 19:13:18 +01:00
maziggy edefce67fe Bumped version 2026-02-10 18:35:24 +01:00
MartinNYHC 38641e91e2 Merge pull request #326 from maziggy/0.1.9
v0.1.9
2026-02-10 18:32:06 +01:00
MartinNYHC e8b2deb54a Merge branch 'main' into 0.1.9 2026-02-10 18:29:35 +01:00
maziggy b886590339 Speed up FTP test suite with class-scoped server fixtures
Function-scoped ftp_server meant 67 TLS server start/stop cycles.
Class-scoped reduces to 10. Adds per-test cleanup fixture to reset
failure injections and filesystem between tests. Isolates
test_disconnect_after_server_gone into its own class to prevent
close_all() from nuking other servers' asyncore sockets.
2026-02-10 18:11:25 +01:00
maziggy 1e5b263acb Added -n auto to run tests in parallel via pytest-xdist 2026-02-10 17:57:40 +01:00
maziggy 5d0d249f1d Fix CI backend-tests failing to collect FTP test suite
CI only installed requirements.txt, missing pyOpenSSL from
requirements-dev.txt. This caused an ImportError on
TLS_FTPHandler during test collection, blocking all
unit/services tests. Also adds pytest-timeout to dev deps
instead of ad-hoc pip install in CI.
v0.1.9
2026-02-10 17:50:32 +01:00
maziggy 23d539f284 Fix CI backend-tests failing to collect FTP test suite
CI only installed requirements.txt, missing pyOpenSSL from
requirements-dev.txt. This caused an ImportError on
TLS_FTPHandler during test collection, blocking all
unit/services tests. Also adds pytest-timeout to dev deps
instead of ad-hoc pip install in CI.
2026-02-10 17:49:58 +01:00
MartinNYHC 8225c29cfe Merge pull request #324 from maziggy/0.1.9
v0.1.9

  Bambuddy v0.1.9 Release Notes

  **Highlights**

This is the biggest release yet — Advanced Authentication via Email, full H2C/H2D Pro nozzle rack support, OrcaSlicer local profiles, configurable slicer preference,  Italian localization, and 50+ bug fixes spanning every printer model.

  ---
  **New Features**

  Advanced Authentication via Email (https://github.com/maziggy/bambuddy/pull/322)

  - Optional SMTP-based email integration for streamlined user onboarding and self-service password management
  - Admins configure SMTP settings and create users with just a username and email — the system generates a secure random password and emails it directly to the new user
  - One-click admin password resets from User Management
  - Users can reset their own forgotten password from the login screen without contacting an admin
  - Customizable email templates for welcome emails and password resets
  - Username and email login is case-insensitive
  - Can be enabled or disabled independently at any time without affecting existing accounts

  Configurable Slicer Preference (https://github.com/maziggy/bambuddy/issues/313)

  - New "Preferred Slicer" setting in General settings to choose between Bambu Studio and OrcaSlicer
  - Controls the protocol used by all "Open in Slicer" buttons across Archives, 3D Preview, and context menus
  - OrcaSlicer uses the orcaslicer://open?file= protocol; default remains Bambu Studio

  Local Profiles — OrcaSlicer Import (https://github.com/maziggy/bambuddy/issues/310)

  - Import slicer presets from OrcaSlicer without Bambu Cloud
  - Supports .orca_filament, .bbscfg, .bbsflmt, .zip, and .json exports
  - Resolves OrcaSlicer inheritance chains by fetching base Bambu profiles from GitHub (cached locally with 7-day TTL)
  - New "Local Profiles" tab on the Profiles page with drag-and-drop import, search, and expandable details
  - Local filament presets appear in AMS slot configuration alongside cloud presets

  Hostname Support for Printers (https://github.com/maziggy/bambuddy/issues/290)

  - Printers can now be added using hostnames (e.g., printer.local, my-printer.home.lan) in addition to IPv4 addresses

  Camera View Controls (https://github.com/maziggy/bambuddy/issues/291)

  - Added chamber light toggle and skip objects buttons to embedded camera viewer and standalone camera page

  Extended Support Bundle Diagnostics

  - Collects comprehensive diagnostic data: printer connectivity, integration status, network interfaces, Python packages, database health, Docker details, WebSocket
  connections, and log file info
  - All data properly anonymized — no IPs, names, or serials included

  ---
  **Improved**

  H2C Nozzle Rack — Full 6-Slot Display (https://github.com/maziggy/bambuddy/issues/300)

  - Always shows all 6 rack positions with filled slots and empty placeholders
  - Compact single-row layout with bottom accent bars (green = mounted, gray = docked)
  - Translates raw nozzle type codes to human-readable names (Hardened Steel, Stainless Steel, Tungsten Carbide, High Flow, Standard)
  - Shows loaded filament material and color in hover card
  - Resolves filament names with 4-tier fallback: Cloud → Local Profiles → built-in lookup table (86 known Bambu codes) → raw ID

  H2 Series — L/R Nozzle Hover Card (https://github.com/maziggy/bambuddy/issues/300)

  - New dual-nozzle hover card shows L and R nozzle details side by side (diameter, type, flow, status, wear, max temp, serial)
  - Active nozzle highlighted in amber; single-nozzle H2D/H2S printers show extended nozzle details on hover

  Firmware Version Badge on Printer Card (https://github.com/maziggy/bambuddy/issues/311)

  - Green badge with checkmark when up to date, orange with download icon when update available
  - Click opens firmware info modal with release notes; respects firmware:read and firmware:update permissions

  Auto-Detect Subnet for Printer Discovery

  - Docker users no longer need to manually enter a subnet — auto-detects available networks with dropdown for multiple subnets

  Japanese Locale Complete Overhaul

  - Restructured ja.ts to match EN/DE structure; translated all 2,083 keys for full parity

  Italian Localization (https://github.com/maziggy/bambuddy/pull/309)

  - New Italian locale contributed by @Keybored02

  ---
  **Bug Fixes**

  - H2C Firmware Downloads Wrong Firmware (https://github.com/maziggy/bambuddy/issues/311) — H2C was mapped to H2D firmware track; added separate h2c API key
  - H2D Pro L/R Nozzle Hover Card Swapped (https://github.com/maziggy/bambuddy/issues/300) — Left and right nozzles were swapped in the hover card
  - H2C Printer Card Shows H2D Image (https://github.com/maziggy/bambuddy/issues/300) — Added dedicated H2C printer image
  - H2C Nozzle Rack Shows Wrong Slots and Missing Colors (https://github.com/maziggy/bambuddy/issues/300) — Fixed mapping by nozzle ID instead of array index; added
  fallback for H2C MQTT field names
  - Nozzle Rack Hides 0% Wear (https://github.com/maziggy/bambuddy/issues/300) — Now correctly shows "Wear: 0%" for new nozzles
  - AMS-HT Mapping Fails for Left Nozzle on H2D Pro (https://github.com/maziggy/bambuddy/issues/318) — Fixed global tray ID calculation for AMS-HT units (ams_id >= 128)
  - H2D Pro Prints Fail at ~75% With Extrusion Motor Overload (https://github.com/maziggy/bambuddy/issues/245) — Fixed use_ams type from integer to boolean for H2D series
  - Virtual Printer FTP Transfer Fails With Connection Reset (https://github.com/maziggy/bambuddy/issues/58) — Fixed async handler completing while data connection was
  still active
  - Virtual Printer IP Override Ignored in Server Mode (https://github.com/maziggy/bambuddy/issues/52) — Network interface override now applies to all modes (TLS
  certificate, SSDP, service restart)
  - Wrong Thumbnail When Reprinting Same Project (https://github.com/maziggy/bambuddy/issues/314) — Cover image cache now cleared on every print start
  - Wrong Timelapse Attached to Archive (https://github.com/maziggy/bambuddy/issues/315) — Replaced mtime-based selection with snapshot-diff approach for reliable
  timelapse detection
  - Calibration Prints Archived (https://github.com/maziggy/bambuddy/issues/315) — Internal printer gcode files under /usr/ now detected and skipped
  - Sidebar Links Custom Icons Inverted Colors (https://github.com/maziggy/bambuddy/issues/308) — Removed CSS invert() filter from user-uploaded icons
  - Spoolman Creates Duplicate Spools on Startup (https://github.com/maziggy/bambuddy/pull/295) — Cached spool data prevents redundant API calls; added retry logic
  - Firmware Badge Shown for Models Without API Data (https://github.com/maziggy/bambuddy/issues/311) — Badge hidden when API returns no firmware data
  - Support Bundle Shows 0 AMS Units — Now handles both nested dict and flat list formats for AMS data
  - GitHub Backup Description Misleading — Updated to correctly state "complete database"
  - Timezone from .env (https://github.com/maziggy/bambuddy/pull/303) — Use TZ from .env instead of hardcoded value
  - FTP TLS 1.3 Compatibility (https://github.com/maziggy/bambuddy/pull/305) — Limit FTP server TLS to 1.2 max for broader client compatibility

  ---
  **Testing**

  - Mock FTPS Server & FTP Test Suite — 67 automated test cases against a real implicit FTPS mock server covering connection, upload, download, model-specific behavior,
  and failure injection
  - Nozzle Rack Tests — Backend: 7 tests for MQTT nozzle_info parsing; Frontend: 3 tests for rack card rendering
  - Advanced Auth Integration Tests — 27 integration tests covering SMTP config, advanced auth toggle, email login, forgot password, admin password reset, and user
  creation

  ---
  **Documentation**

  - Advanced Auth via Email — Updated README, website, and wiki with SMTP setup and self-service password guides
  - Supported Printers — All 12 Bambu Lab models now listed uniformly (X1, X1C, X1E, P1P, P1S, P2S, A1, A1 Mini, H2D, H2D Pro, H2C, H2S)
  - CONTRIBUTING.md — Added i18n conventions and authentication/permissions guide
  - Proxy Mode — FTP data channel security warning, passive port documentation, SSDP discovery limitations table

  ---
  **Community Contributors**

  Thank you to everyone who contributed to this release!

  - @cadtoolbox (Thomas Rambach) — Advanced Authentication via Email (https://github.com/maziggy/bambuddy/pull/322)
  - @Keybored02 — Italian localization (https://github.com/maziggy/bambuddy/pull/309)
  - @notti (Gernot Vormayr) — FTP TLS 1.2 version limit (https://github.com/maziggy/bambuddy/pull/305)
  - @bnap00 (Bharat Parsiya) — Timezone environment variable fix (https://github.com/maziggy/bambuddy/pull/303)
  - @bambuman — Spoolman duplicate spool fix (https://github.com/maziggy/bambuddy/pull/295) and Home Assistant environment variables
  (https://github.com/maziggy/bambuddy/pull/294)

  ---
2026-02-10 17:44:40 +01:00
maziggy 51f08a5c86 Suppress Bandit false positives in virtual printer and tests
B108: /tmp paths in test mocks (not real filesystem access).
B104: string comparisons against "0.0.0.0" (not socket binds).
2026-02-10 17:41:16 +01:00
maziggy d334e2a3ef Fix SMTP endpoints returning 401 when authentication is disabled
SMTP settings endpoints (GET/POST /auth/smtp, POST /auth/smtp/test)
used Depends(get_current_active_user) which always requires a logged-in
user. Replaced with RequirePermissionIfAuthEnabled to match the pattern
used by all other settings endpoints — accessible when auth is disabled,
permission-gated when auth is enabled.
2026-02-10 17:35:26 +01:00
maziggy fe2f001143 package-lock-only 2026-02-10 17:24:14 +01:00
maziggy c56a67219e Pinned i18next to exact version 25.6.3 2026-02-10 17:22:47 +01:00
maziggy 1d32efa239 Bumped version 2026-02-10 17:10:34 +01:00
maziggy ea5b9b3011 Post work PR #322 2026-02-10 17:08:34 +01:00
MartinNYHC 6ecc29de54 Merge pull request #322 from cadtoolbox/feature_user_authentication
Feature - Advanced Authentication via Email
2026-02-10 16:41:39 +01:00
maziggy 142c7f99f6 Merge branch 'feature_user_authentication' of https://github.com/cadtoolbox/bambuddy into test-merge
# Conflicts:
#	frontend/src/components/ConfigureAmsSlotModal.tsx
#	frontend/src/i18n/locales/ja.ts
#	static/index.html
2026-02-10 16:40:10 +01:00
maziggy 0282fbd442 Fix H2D Pro L/R nozzle hover card swap and hide left-only fields (#300)
Nozzle rack id 0 = extruder 0 = right nozzle, id 1 = extruder 1 = left.
The dual-nozzle hover card had them backwards, showing serial number and
max temp on the left column instead of the right. Serial and max temp
are now restricted to the right (removable) nozzle only. Single-nozzle
fallback (H2D, H2C) updated to use the primary nozzle (id 0).
2026-02-10 16:15:53 +01:00
Thomas Rambach 994843e24a Merge pull request #31 from cadtoolbox/copilot/update-static-text-for-i18n
Internationalize Advanced Authentication strings
2026-02-10 10:00:34 -05:00
copilot-swe-agent[bot]andcadtoolbox 099896a3c6 Internationalize Advanced Authentication error messages and dropdown options
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-10 14:55:25 +00:00
maziggy 9484f263ab Add built-in filament name lookup table for nozzle rack and AMS tooltips (#300)
The Bambu Cloud API returns 400 for many filament IDs (e.g. GFB01,
GFU99, GFL99), causing nozzle rack hover cards to fall back to
abbreviated tray_type values ("ASA", "TPU", "PLA") instead of full
names.

Added a built-in lookup table of 86 known Bambu filament codes as a
Phase 4 fallback in get_filament_info. Resolution order is now:
cache → cloud API → local profiles → built-in table → empty fallback.

GFB01 → "Bambu ASA", GFU99 → "Generic TPU", GFL99 → "Generic PLA",
etc. Also benefits AMS tray tooltips for unresolvable filament IDs.
2026-02-10 15:39:16 +01:00
copilot-swe-agent[bot]andcadtoolbox 466260397e Revert technical example placeholders to hardcoded values
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-10 14:38:58 +00:00
copilot-swe-agent[bot]andcadtoolbox 903f43d71a feat(i18n): update frontend components to use translations
- Add i18n support to AddSmartPlugModal.tsx
- Add i18n support to ConfigureAmsSlotModal.tsx
- Add i18n support to RichTextEditor.tsx
- Add i18n support to ExternalLinksSettings.tsx
- Replace all hardcoded English strings with t() calls

Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-10 14:26:51 +00:00
maziggy 2080665773 Updated CHANGELOG and README 2026-02-10 15:23:19 +01:00
copilot-swe-agent[bot]andcadtoolbox e57ab8bf7e Update SmartPlugCard to use i18n translations
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-10 14:22:34 +00:00
copilot-swe-agent[bot]andcadtoolbox ae57ff73e9 Fix duplicate key errors in de.ts and ja.ts locale files
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-10 14:21:11 +00:00
copilot-swe-agent[bot]andcadtoolbox 3e962a4977 Add new i18n translation keys to locale files (work in progress - fixing duplicates)
Co-authored-by: cadtoolbox <12723486+cadtoolbox@users.noreply.github.com>
2026-02-10 14:14:41 +00:00
maziggy f7cd173118 Fix H2C printer image and resolve nozzle rack filament names (#300)
1. H2C printer card was showing the H2D image — added dedicated
   h2c.png and updated getPrinterImage() mapping.

2. Nozzle rack hover card showed raw filament IDs (e.g. "GFU99")
   instead of human-readable names. Now resolves names via 3-tier
   fallback: Bambu Cloud → local slicer profiles → raw ID.
   - Frontend: nozzle rack filament_id values included in cloud
     lookup query; NozzleSlotHoverCard displays resolved name.
   - Backend: get_filament_info endpoint refactored from cloud-only
     to cache → cloud → local profiles. Matches local presets by
     setting_id in the imported OrcaSlicer JSON blob.
2026-02-10 15:12:14 +01:00
copilot-swe-agent[bot] 8eb634e85f Initial plan 2026-02-10 14:03:25 +00:00
Thomas Rambach 0c1e29954a Merge branch 'feature_user_authentication' of https://github.com/cadtoolbox/bambuddy into feature_user_authentication 2026-02-10 08:57:20 -05:00
Thomas Rambach 43d7788651 Removed Trailing Whitespaces 2026-02-10 08:57:09 -05:00
maziggy 7f22260c90 Fix H2C nozzle rack wrong empty slot, missing filament colors, and medium card layout (#300)
Three fixes for the H2C nozzle rack reported by testers:

1. Empty slot position: rack nozzles were mapped by sequential array
   index instead of by actual nozzle ID (16-21), so a missing slot
   always appeared at position 6 instead of its real position. Now
   maps each nozzle to its correct rack position via id offset.

2. Missing filament colors/materials: the H2C MQTT payload uses
   different field names than H2D — color_m (not filament_colour),
   fila_id (not filament_id), sn (not serial_number), tm (not
   max_temp). Added fallback field name resolution in the backend
   MQTT parser.

3. Medium card layout: the temperature row with nozzle rack overflowed
   on medium-sized cards. Added flex-wrap and a 190px flex-basis on
   the rack card so it wraps to a second line when space is tight.
2026-02-10 14:05:55 +01:00
maziggy c5fff9bc15 Fix AMS-HT mapping for left nozzle on H2D Pro (#318)
AMS-HT global tray ID was calculated as ams_id * 4 (= 512 for unit 128)
but AMS-HT uses the raw ams_id directly since it has a single tray.
The backend misidentified 512 as an external spool, producing wrong
ams_mapping2. Fixed in 4 locations: frontend getGlobalTrayId(), backend
start_print() ams_mapping2 builder, print scheduler, and Spoolman tracking.
2026-02-10 13:54:21 +01:00
maziggy 94ba65e3bc Fix H2C nozzle rack display and add L/R hover cards (#300)
Rack card now shows 6 rack-only slots (IDs 16-21) with empty placeholders,
excluding L/R hotend nozzles. New DualNozzleHoverCard shows both nozzle
details side-by-side with Active/Idle status. Single-nozzle H2 printers
get extended hover details. Backend stores nozzle_info for all H2 series.
Added i18n keys (en/de/ja) and 10 tests (7 backend + 3 frontend).
2026-02-10 13:40:03 +01:00