From 5bddd63ec13b73b4777a7409ea9fe3fc0306f2a6 Mon Sep 17 00:00:00 2001 From: DasPoschi Date: Wed, 31 Dec 2025 12:49:07 +0100 Subject: [PATCH] Update device status handling in app.py Change device status check to warn on non-ONLINE states. --- jd-webgui/app.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jd-webgui/app.py b/jd-webgui/app.py index 371d67f..f0b7277 100644 --- a/jd-webgui/app.py +++ b/jd-webgui/app.py @@ -174,13 +174,13 @@ def get_device(): time.sleep(2) continue - status = (d.get("status") or "").upper() - # accept ONLINE/CONNECTED; some setups use different strings - if status in {"ONLINE", "CONNECTED"}: - return jd.get_device(d["name"]) + status = (d.get("status") or "").upper() + if status not in {"ONLINE", "CONNECTED"}: + # just a warning; do not fail + print(f"[WARN] Device status is {status}, continuing anyway...") + return jd.get_device(d["name"]) + - # sometimes myjdapi reports UNKNOWN briefly; give it time - time.sleep(2) # no ONLINE device after waiting if last: