From 030bee95ca5a9612f854ba73f2882ca3f6e838f0 Mon Sep 17 00:00:00 2001 From: agessaman Date: Fri, 21 Aug 2026 20:38:27 -0700 Subject: [PATCH] fix(dashboard): narrow snr directly so mypy accepts float(snr) mypy cannot track non-Noneness through the intermediate `corroborated` boolean, so `float(snr)` in the discover-only neighbor branch was flagged as `Any | None`. Test the value directly; `corroborated` still backs the `signal_corroborated` field. --- modules/web_viewer/dashboard_stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/web_viewer/dashboard_stats.py b/modules/web_viewer/dashboard_stats.py index 415a6af..fc5e798 100644 --- a/modules/web_viewer/dashboard_stats.py +++ b/modules/web_viewer/dashboard_stats.py @@ -1338,7 +1338,7 @@ class DashboardStatsService: "name": (contact["name"] if contact else None) or key[:12], "public_key": (contact["public_key"] if contact else key), "role": normalize_role(contact["role"] if contact else None), - "snr": round(float(snr), 1) if corroborated else None, + "snr": round(float(snr), 1) if snr is not None else None, "rssi": None, "signal_corroborated": corroborated, "last_seen": link.get("last_seen"),