checkin: take sdr_count from secondary-sdr first; op25's 0 is never real
op25's :stable image has no lsusb, and /op25/devices answers count 0 instead of unknown, so the dashboard said radio-box 'reports 0 SDRs' with 2 plugged in. Prefer the secondary-sdr container's lsusb count; treat 0 from op25 as unknown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
358766d88b
commit
3ecc7eff1a
@@ -237,11 +237,13 @@ class MQTTManager:
|
|||||||
secondary = await secondary_sdr_client.status()
|
secondary = await secondary_sdr_client.status()
|
||||||
if secondary is not None:
|
if secondary is not None:
|
||||||
payload["secondary_sdr_running"] = [r["mode"] for r in secondary.get("running", [])]
|
payload["secondary_sdr_running"] = [r["mode"] for r in secondary.get("running", [])]
|
||||||
# Best-effort hardware report — omit rather than guess. op25's :stable
|
# Best-effort hardware report — omit rather than guess. Prefer the
|
||||||
# image has no lsusb, so fall back to the secondary-sdr container's count.
|
# secondary-sdr container's count: op25's :stable image has no lsusb and
|
||||||
count = devices.get("count") if devices else None
|
# its /op25/devices answers 0 rather than "unknown" when that fails. A
|
||||||
if count is None and secondary is not None:
|
# node running op25 has at least one SDR, so 0 is never a real reading.
|
||||||
count = secondary.get("sdr_count")
|
count = secondary.get("sdr_count") if secondary is not None else None
|
||||||
|
if not count and devices:
|
||||||
|
count = devices.get("count") or None
|
||||||
if count is not None:
|
if count is not None:
|
||||||
payload["sdr_count"] = count
|
payload["sdr_count"] = count
|
||||||
self._publish(self._t_checkin, payload, qos=1)
|
self._publish(self._t_checkin, payload, qos=1)
|
||||||
|
|||||||
Reference in New Issue
Block a user