fix(printers): drop P1S / P1P from door-sensor badge whitelist (#1866)

P1S has an enclosure door but no hall sensor for it; P1P has no
enclosure at all. Both models were rendering a permanent green
"Door Closed" chip driven by bit 23 of the stat field, which stays
0 forever on that firmware. Whitelist now covers only models that
actually ship with a door sensor: X1 family, X2D, P2S, and H2 family.
Corrected the matching stale comments in the PrinterStatus TS
interface (client.ts) and PrinterState dataclass (bambu_mqtt.py).

Backend parse left as-is — cheap and future-proof if Bambu ever
wires the P-series enclosure into a sensor.
This commit is contained in:
maziggy
2026-07-01 08:58:22 +02:00
parent e33ab07a93
commit b71d486058
6 changed files with 9 additions and 6 deletions
+2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -292,7 +292,7 @@ class PrinterState:
ipcam: bool = False # Live view / camera streaming enabled
wifi_signal: int | None = None # WiFi signal strength in dBm
wired_network: bool = False # Ethernet connection detected (home_flag bit 18)
door_open: bool = False # Enclosure door open (home_flag bit 23, X1/P1S/P2S/H2*)
door_open: bool = False # Enclosure door open (home_flag bit 23; models with a door sensor: X1/X1C/X1E/X2D/P2S/H2*)
# Nozzle hardware info (for dual nozzle printers, index 0 = left, 1 = right)
nozzles: list = field(default_factory=lambda: [NozzleInfo(), NozzleInfo()])
# AI detection and print options
+1 -1
View File
@@ -470,7 +470,7 @@ export interface PrinterStatus {
ipcam: boolean; // Live view enabled
wifi_signal: number | null; // WiFi signal strength in dBm
wired_network: boolean; // Ethernet connection detected
door_open: boolean; // Enclosure door open (X1/P1S/P2S/H2*)
door_open: boolean; // Enclosure door open (models with a door sensor: X1/X1C/X1E/X2D/P2S/H2*)
nozzles: NozzleInfo[]; // Nozzle hardware info (index 0=left/primary, 1=right)
nozzle_rack: NozzleRackSlot[]; // H2C 6-nozzle tool-changer rack
print_options: PrintOptions | null; // AI detection and print options
+3 -2
View File
@@ -3391,8 +3391,9 @@ function PrinterCard({
</span>
) : null}
{/* Enclosure Door Badge (X1/X2D/P1S/P2S/H2*) */}
{status?.connected && ['X1C', 'X1', 'X1E', 'X2D', 'P1S', 'P1P', 'P2S', 'H2D', 'H2D Pro', 'H2C', 'H2S'].includes(printer.model ?? '') && (
{/* Enclosure Door Badge — models with an actual door sensor.
P1S has an enclosure door but no sensor; P1P has no enclosure at all. */}
{status?.connected && ['X1C', 'X1', 'X1E', 'X2D', 'P2S', 'H2D', 'H2D Pro', 'H2C', 'H2S'].includes(printer.model ?? '') && (
<span
className={`flex items-center px-2 py-1 rounded-full text-xs ${
status.door_open
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -26,7 +26,7 @@
<!-- Splash screens for iOS -->
<link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
<script type="module" crossorigin src="/assets/index-CWQmJXDv.js"></script>
<script type="module" crossorigin src="/assets/index-DiaNe89t.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BxVhuRti.css">
</head>
<body>