mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-08 15:11:21 +02:00
Show Spoolman fill level for AMS Lite and external spools (#293)
AMS Lite units (A1 series) have no weight sensor and always report 0% fill level. When a spool is linked to Spoolman with weight data, use Spoolman's remaining weight as a fallback. External spools also show fill level from Spoolman data instead of always showing unknown. Backend: Enrich GET /spoolman/spools/linked response with remaining_weight and filament_weight alongside spool ID. Frontend: Add getSpoolmanFillLevel() helper. Update regular AMS, HT AMS, and external spool fill computations to use Spoolman fallback when AMS reports 0%. Show "(Spoolman)" indicator in hover card when fill data comes from Spoolman.
This commit is contained in:
@@ -10,6 +10,7 @@ interface FilamentData {
|
||||
kFactor: string;
|
||||
fillLevel: number | null; // null = unknown
|
||||
trayUuid?: string | null; // Bambu Lab spool UUID for Spoolman linking
|
||||
fillSource?: 'ams' | 'spoolman'; // Source of fill level data
|
||||
}
|
||||
|
||||
interface SpoolmanConfig {
|
||||
@@ -229,8 +230,11 @@ export function FilamentHoverCard({ data, children, disabled, className = '', sp
|
||||
<Droplets className="w-3 h-3" />
|
||||
{t('ams.fill')}
|
||||
</span>
|
||||
<span className="text-xs text-white font-semibold">
|
||||
<span className="text-xs text-white font-semibold flex items-center gap-1">
|
||||
{data.fillLevel !== null ? `${data.fillLevel}%` : '—'}
|
||||
{data.fillSource === 'spoolman' && data.fillLevel !== null && (
|
||||
<span className="text-[9px] text-bambu-gray font-normal">{t('spoolman.fillSourceLabel')}</span>
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
{/* Fill bar */}
|
||||
|
||||
Reference in New Issue
Block a user