mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-18 03:54:17 +02:00
feat: add bed cooled notification after print completes (#378)
Notify users when the print bed cools below a configurable threshold (default 35°C) after a print finishes, so they know when to remove parts. - Backend: DB migration, model, schemas, notification template, service method, background cooldown monitor (polls every 15s, 30min timeout) - Frontend: event toggle in provider card/modal, threshold setting in Settings > Notifications, i18n keys for all 5 locales - Tests: 4 backend + 4 frontend tests - Docs: README, website, wiki updated
This commit is contained in:
@@ -46,6 +46,7 @@ export function AddNotificationModal({ provider, onClose }: AddNotificationModal
|
||||
const [onPrinterError, setOnPrinterError] = useState(provider?.on_printer_error ?? false);
|
||||
const [onFilamentLow, setOnFilamentLow] = useState(provider?.on_filament_low ?? false);
|
||||
const [onMaintenanceDue, setOnMaintenanceDue] = useState(provider?.on_maintenance_due ?? false);
|
||||
const [onBedCooled, setOnBedCooled] = useState(provider?.on_bed_cooled ?? false);
|
||||
|
||||
// Provider-specific config
|
||||
const [config, setConfig] = useState<Record<string, string>>(
|
||||
@@ -145,6 +146,7 @@ export function AddNotificationModal({ provider, onClose }: AddNotificationModal
|
||||
on_printer_error: onPrinterError,
|
||||
on_filament_low: onFilamentLow,
|
||||
on_maintenance_due: onMaintenanceDue,
|
||||
on_bed_cooled: onBedCooled,
|
||||
};
|
||||
|
||||
if (isEditing) {
|
||||
@@ -486,6 +488,13 @@ export function AddNotificationModal({ provider, onClose }: AddNotificationModal
|
||||
</div>
|
||||
<Toggle checked={onPrintProgress} onChange={setOnPrintProgress} />
|
||||
</div>
|
||||
<div className="flex items-center justify-between col-span-2">
|
||||
<div>
|
||||
<span className="text-sm text-white">Bed Cooled</span>
|
||||
<span className="text-xs text-bambu-gray ml-1">(after print completes)</span>
|
||||
</div>
|
||||
<Toggle checked={onBedCooled} onChange={setOnBedCooled} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user