fix: remove incorrect ethernet badge on printer cards

home_flag bit 18 was incorrectly interpreted as "wired/ethernet
  connection", causing the ethernet badge to always show — even on
  printers without an ethernet port (e.g. A1, P1S). This hid the
  WiFi signal indicator entirely.

  Removed the wired_network field and ethernet badge UI. The WiFi
  signal badge now shows correctly whenever the printer reports
  signal strength.
This commit is contained in:
maziggy
2026-03-09 12:17:44 +01:00
parent 0efb4690b9
commit c9d0ff622f
10 changed files with 9347 additions and 40 deletions
-1
View File
@@ -571,7 +571,6 @@ async def get_printer_status(
timelapse=state.timelapse,
ipcam=state.ipcam,
wifi_signal=state.wifi_signal,
wired_network=state.wired_network,
nozzles=nozzles,
nozzle_rack=nozzle_rack,
print_options=print_options,
+1 -2
View File
@@ -139,7 +139,7 @@ class AMSUnit(BaseModel):
is_ams_ht: bool = False # True for AMS-HT (single spool), False for regular AMS (4 spools)
tray: list[AMSTray] = []
serial_number: str = "" # AMS unit serial number (sn from MQTT)
sw_ver: str = "" # AMS firmware version (from get_version info.module)
sw_ver: str = "" # AMS firmware version (from get_version info.module)
class NozzleInfoResponse(BaseModel):
@@ -212,7 +212,6 @@ class PrinterStatus(BaseModel):
timelapse: bool = False # Timelapse recording active
ipcam: bool = False # Live view enabled
wifi_signal: int | None = None # WiFi signal strength in dBm
wired_network: bool = False # Ethernet connection detected
nozzles: list[NozzleInfoResponse] = [] # Nozzle hardware info (index 0=left/primary, 1=right)
nozzle_rack: list[NozzleRackSlot] = [] # H2C 6-nozzle tool-changer rack
print_options: PrintOptionsResponse | None = None # AI detection and print options
-3
View File
@@ -120,7 +120,6 @@ class PrinterState:
timelapse: bool = False # Timelapse recording active
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)
# 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
@@ -2071,8 +2070,6 @@ class BambuMQTTClient:
f"[{self.serial_number}] store_to_sdcard changed: {self.state.store_to_sdcard} -> {store_to_sdcard}"
)
self.state.store_to_sdcard = store_to_sdcard
# Bit 18 (0x00040000) indicates wired/ethernet connection
self.state.wired_network = bool((home_flag >> 18) & 1)
# Parse timelapse status (recording active during print)
if "timelapse" in data:
-1
View File
@@ -668,7 +668,6 @@ def printer_state_to_dict(state: PrinterState, printer_id: int | None = None, mo
"ams_extruder_map": ams_extruder_map,
# WiFi signal strength
"wifi_signal": state.wifi_signal,
"wired_network": state.wired_network,
# Calibration stage tracking
"stg_cur": state.stg_cur,
"stg_cur_name": get_derived_status_name(state, model),
-1
View File
@@ -212,7 +212,6 @@ export interface PrinterStatus {
timelapse: boolean; // Timelapse recording active
ipcam: boolean; // Live view enabled
wifi_signal: number | null; // WiFi signal strength in dBm
wired_network: boolean; // Ethernet connection detected
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 -13
View File
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { X, Copy, Check, Signal, Cable } from 'lucide-react';
import { X, Copy, Check, Signal } from 'lucide-react';
import { Card, CardContent } from './Card';
import { formatDateOnly } from '../utils/date';
import { getPrinterImage, getWifiStrength } from '../utils/printer';
@@ -109,18 +109,8 @@ export function PrinterInfoModal({ printer, status, totalPrintHours, onClose }:
),
});
// Network connection
if (status?.wired_network) {
rows.push({
label: t('printers.networkLabel', 'Network'),
value: (
<span className="flex items-center gap-2">
<Cable className="w-4 h-4 text-bambu-green" />
<span className="text-bambu-green">{t('printers.connection.ethernet', 'Ethernet')}</span>
</span>
),
});
} else if (status?.wifi_signal != null) {
// WiFi signal
if (status?.wifi_signal != null) {
const wifi = getWifiStrength(status.wifi_signal);
rows.push({
label: t('printers.wifiSignalLabel'),
+2 -12
View File
@@ -44,7 +44,6 @@ import {
Home,
Printer as PrinterIcon,
Info,
Cable,
} from 'lucide-react';
import { useNavigate } from 'react-router-dom';
@@ -2452,17 +2451,8 @@ function PrinterCard({
)}
{status?.connected ? t('printers.connection.connected') : t('printers.connection.offline')}
</span>
{/* Network connection indicator */}
{status?.connected && status?.wired_network && (
<span
className="flex items-center gap-1 px-2 py-1 rounded-full text-xs bg-status-ok/20 text-status-ok"
title={t('printers.connection.ethernet', 'Ethernet')}
>
<Cable className="w-3 h-3" />
{t('printers.connection.ethernet', 'Ethernet')}
</span>
)}
{status?.connected && !status?.wired_network && wifiSignal != null && (
{/* WiFi signal indicator */}
{status?.connected && wifiSignal != null && (
<span
className={`flex items-center gap-1 px-2 py-1 rounded-full text-xs ${
wifiSignal >= -50
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5
View File
@@ -23,8 +23,13 @@
<!-- Splash screens for iOS -->
<link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
<<<<<<< HEAD
<script type="module" crossorigin src="/assets/index-CDBlYFWf.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DfcIVNpM.css">
=======
<script type="module" crossorigin src="/assets/index-CnBVCYFe.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BoLtXYT2.css">
>>>>>>> 121b3d5 ( fix: remove incorrect ethernet badge on printer cards)
</head>
<body>
<div id="root"></div>