ソースを参照

Printer card: H2 series and H3C exhaust fan labelled Exhaust (#3521)

- Fan 3 is the exhaust fan on the H2D, H2D Pro, H2C, H2S and H3C; Bambu
  Studio names it "Exhaust" and only the X1 series and P1S files rename
  it "Chamber". Added them to MODELS_WITH_EXHAUST_LABEL.
- Visibility moved to MODELS_WITH_EXHAUST_KIT (P2S, X2D): the built-in
  fan on the H2 series and H3C stays always shown.
- Test per model for the label and the always-shown badge.
maziggy 1 週間 前
親
コミット
25167564e9

+ 1 - 0
CHANGELOG.md

@@ -27,6 +27,7 @@ All notable changes to Bambuddy will be documented in this file.
 - **"Any model" jobs go to the printer with the fewest print hours (#3480, sponsor vote Q4 2026)** — When several printers of a model can take a job, the queue used to pick the first one in its list, so on a farm the same printer got most of the work. It now picks the one with the fewest print hours (the Maintenance counter, including baseline hours entered there), so jobs and wear spread across the farm. Preferred colours still come first, and the queue powers on the least used printer too when it has to switch one on with an Auto Power On plug.
 
 ### Fixed
+- **The H2 series' and the H3C's exhaust fan is labelled Exhaust (#3521, reported by @Spegeli)** — The printer card called fan 3 "Chamber Fan" on the H2D, H2D Pro, H2C, H2S and H3C. On these printers it is the exhaust fan in the back wall, which Bambu Studio names "Exhaust", as on the P2S and X2D. Only the X1 series and P1S call it the chamber fan. The badge is still always shown on these printers, since the fan is built in.
 - **Spools keep their ids when the inventory moves by CSV (#3520, reported by @hurr1k4ne)** — The CSV export had no id column, so importing it on another instance numbered the spools anew, in the order of the file, and every printed label, whose QR code carries the spool's id, found the wrong spool or none. The export now writes each spool's id, and the import keeps it when that instance has never used it, which on a fresh instance is every id. An id already used there, also by a deleted spool, or named twice in the file gets a new one, and the preview says how many. The preview shows the id each spool keeps. A CSV without the column imports as before.
 - **A spool with a custom cloud preset gets it from a SpoolBuddy client too (#3519, reported by @pleasantone)** — With login on, each user signs in to Bambu Cloud separately. Assigning a spool from an API key, as a SpoolBuddy client does, had no signed-in user, so its custom preset (PFUS or PFCN) could not be looked up and the slot got Generic PLA, while the same assign from the web UI got the preset's own filament. Configuring a pre-assigned slot when the spool is inserted had the same problem, even for assignments made in the web UI. Both now use a user's sign-in: the API key's owner, and whoever made the assignment. A custom preset that still can't be looked up is now named in the log.
 - **Closing a camera view no longer leaves a CPU core at 100% (#3515, reported by @BrainDeLook)** — A viewer leaving while its stream was reading from the SQLite database could leave that connection's close waiting forever, on a bug in aiosqlite (omnilib/aiosqlite#403). Bambuddy then kept one CPU core fully busy, even with every viewer closed, and other pages such as Projects and Spool Inventory became very slow until a restart. Bambuddy now works around the aiosqlite bug, for every database connection, not only the camera's, and the camera stream's short reads (the chamber light settings and the periodic access check) finish before a leaving viewer ends the stream. PostgreSQL was not affected.

+ 14 - 0
frontend/src/__tests__/pages/PrintersPage.test.tsx

@@ -380,6 +380,20 @@ describe('PrintersPage', () => {
       expect(screen.queryByTitle('Exhaust')).not.toBeInTheDocument();
     });
 
+    // Built in on these, and "Exhaust" in Bambu Studio: no printer file renames
+    // part 3 for them (#3521). Shown without exhaust_fan_present.
+    it.each(['H2D', 'H2D Pro', 'H2C', 'H2S', 'H3C'])(
+      'labels the built-in fan "Exhaust" on the %s and always shows it',
+      async (model) => {
+        renderWithStatus({ ...mockPrinters[0], model }, { ...statusWithFans, exhaust_fan_present: false });
+
+        await waitFor(() => {
+          expect(screen.getByTitle('Exhaust')).toBeInTheDocument();
+        });
+        expect(screen.queryByTitle('Chamber Fan')).not.toBeInTheDocument();
+      },
+    );
+
     it('hides the left aux badge when the accessory is not reported', async () => {
       renderWithStatus({ ...mockPrinters[0], model: 'P2S' }, statusWithFans);
 

+ 28 - 16
frontend/src/pages/PrintersPage.tsx

@@ -1765,17 +1765,30 @@ const MODELS_WITH_CHAMBER_FAN: ReadonlySet<string> = new Set([
   'H3C',
 ]);
 
-// On the P2S/X2D, the enclosure fan (big_fan2 / airduct part id 3) is a
-// dedicated chamber EXHAUST fan: it's its own control and stays the same
-// regardless of cooling/heating mode (unlike the aux fan, id 2, which a flap
-// re-tasks between part-cooling and chamber-filter recirculation). Bambu's own
-// firmware/UI and Bambu Studio (FAN_CHAMBER_0_IDX -> "Exhaust") label it
-// "Exhaust" on these models. Other enclosed models (X1/P1S/H2*) keep "Chamber".
+// The enclosure fan (big_fan2 / airduct part id 3) is the chamber EXHAUST fan
+// on these models: its own control, the same in cooling and heating mode
+// (unlike the aux fan, id 2, which a flap re-tasks between part cooling and
+// chamber-filter recirculation). Bambu Studio names part 3 "Exhaust"
+// (FAN_CHAMBER_0_IDX) unless a printer's file renames it, and only the X1
+// Carbon, X1, X1E and P1S files rename it to "Chamber", so those keep that
+// label. The H2 series and the H3C were missing here (#3521); the H3C's own
+// "Chamber" fan is a different one, part 15.
 const MODELS_WITH_EXHAUST_LABEL: ReadonlySet<string> = new Set([
   'P2S',
   'X2D',
+  'H2D',
+  'H2D Pro',
+  'H2C',
+  'H2S',
+  'H3C',
 ]);
 
+// Where the exhaust fan is an add-on kit rather than built in, so its badge
+// waits for the printer to report it (exhaust_fan_present). It is fitted from
+// the factory on the X2D, which reports it all the same. Kept apart from the
+// label set: the H2 series and the H3C have it built in and always show it.
+const MODELS_WITH_EXHAUST_KIT: ReadonlySet<string> = new Set(['P2S', 'X2D']);
+
 // Models whose aux fan (airduct part 2) is the LEFT one and part 10 the right
 // (#3373). Bambu Studio names them per model: on the X2D (N6) "2" is Left(Aux)
 // and "10" Right(Aux); on the P2S (N7) it is the other way round. Display
@@ -4652,23 +4665,22 @@ function PrinterCard({
               // control that does nothing. Mirrors the enclosure-door badge
               // gate above.
               const hasChamberFan = MODELS_WITH_CHAMBER_FAN.has(printer.model ?? '');
-              // On P2S/X2D the big_fan2 fan is the dedicated chamber EXHAUST fan
-              // ("Exhaust" in Bambu's naming) and is an add-on kit, not preinstalled:
-              // show it only when the printer actually reports it (airduct part id 3,
-              // surfaced as exhaust_fan_present). Other enclosed models (X1/P1S/H2*)
-              // have a built-in chamber fan that's always present, so they keep the
-              // existing model-list gate and the "Chamber Fan" label.
-              const isExhaustModel = MODELS_WITH_EXHAUST_LABEL.has(printer.model ?? '');
-              const chamberFanLabel = isExhaustModel
+              // The big_fan2 fan is "Exhaust" in Bambu's naming on the models in
+              // MODELS_WITH_EXHAUST_LABEL and "Chamber Fan" on the rest. On
+              // P2S/X2D it is an add-on kit, not preinstalled: show it only when
+              // the printer actually reports it (airduct part id 3, surfaced as
+              // exhaust_fan_present). Elsewhere it is built in and always shown.
+              const chamberFanLabel = MODELS_WITH_EXHAUST_LABEL.has(printer.model ?? '')
                 ? t('printers.fans.exhaust')
                 : t('printers.fans.chamber');
+              const isExhaustKitModel = MODELS_WITH_EXHAUST_KIT.has(printer.model ?? '');
               // Composed rather than either/or so both lists stay live for
               // P2S/X2D: the model must have an enclosure fan at all, AND —
               // where that fan is an add-on kit — actually report it. Written
-              // as `isExhaustModel ? exhaust_fan_present : hasChamberFan` the
+              // as `isExhaustKitModel ? exhaust_fan_present : hasChamberFan` the
               // P2S/X2D entries in MODELS_WITH_CHAMBER_FAN became unreachable,
               // which reads as if removing them were safe.
-              const showChamberFan = hasChamberFan && (!isExhaustModel || status.exhaust_fan_present);
+              const showChamberFan = hasChamberFan && (!isExhaustKitModel || status.exhaust_fan_present);
               // The second auxiliary part cooling fan (airduct part id 10):
               // the left one on the P2S (an accessory kit), the right one on
               // the X2D, where part 2 is the left. Only reported (non-null)