diff --git a/main.py b/main.py index cae31c6..8a67ebd 100644 --- a/main.py +++ b/main.py @@ -107,9 +107,11 @@ async def _printer_monitor_loop(printer_svc: PrinterService, led_svc: LEDService while True: try: statuses = await printer_svc.get_printers_status() + # "offline" = imprimante absente du réseau → normal si non branchée + # On alerte uniquement si l'imprimante est joignable MAIS en panne + # (state=disabled/stopped avec des raisons d'erreur concrètes) has_error = any( - s.get("state") in ("disabled", "error", "offline") - or bool(s.get("reasons")) + s.get("state") in ("disabled", "error") and bool(s.get("reasons")) for s in statuses ) current = led_svc.current_effect