mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-08-23 11:00:10 +00:00
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.
This commit is contained in:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user