From 5bc55c7591deb6651507408c659ad8dd3c79ec33 Mon Sep 17 00:00:00 2001 From: jbperrin Date: Fri, 17 Jul 2026 17:25:47 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20moniteur=20imprimante=20ignore=20les=20i?= =?UTF-8?q?mprimantes=20offline=20(non=20branch=C3=A9es)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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