Tell a dead device, a failed connection and a disabled connection apart.

Ping failures now read NO PING, Companion connection errors OFFLINE, and a
watched connection that is disabled in Companion shows amber DISABLED instead
of going quietly grey.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 10:29:50 -04:00
co-authored by Claude Opus 5.5
parent 1f2c5719fb
commit 51bd44f9a0
3 changed files with 15 additions and 6 deletions
+3 -2
View File
@@ -166,7 +166,8 @@ def conn_result(snap, label, now, service_only=False):
if c is None:
return Result(ERR, "NOT IN COMPANION", service_only=service_only)
if not c.get("enabled"):
return Result(OFF, info="DISABLED")
# Everything on the page is expected on; a disabled connection is a warning, not silence.
return Result(WARN, "DISABLED")
cat = c.get("category")
if cat == "good":
return Result(OK)
@@ -345,7 +346,7 @@ def check_tascam(chk, snap, ctx):
def check_ping(chk, snap, ctx):
fails = snap.ping.get(chk["host"])
if fails is not None and fails >= chk.get("failures", 2):
msg = chk.get("msg") or chk.get("name", chk["host"]) + " OFFLINE"
msg = chk.get("msg") or chk.get("name", chk["host"]) + " NO PING"
return [("ping", Result(ERR, msg, service_only=chk.get("service_only", False), named=True))]
return [("ping", Result(OK))]