{# Bus health snapshot — auto-refreshed every 10s. Whole card is the swap target (id=openlcb-health) so both label + counts flip in one atomic swap. When health is None (non-OpenLCB connection or a fetch error) the fragment renders empty. #}
{% if health %}

Bus health

Nodes
{{ health.total_nodes }}
Identified (NID)
{{ health.identified }}/{{ health.total_nodes }}
SNIP cached
{{ health.with_snip }}/{{ health.total_nodes }}
PIP cached
{{ health.with_pip }}/{{ health.total_nodes }}
Quiet
{{ health.quiet_count }}
Longest silence
{% if health.oldest_silence_seconds is none %} — {% elif health.oldest_silence_seconds < 60 %} {{ '%.0f' | format(health.oldest_silence_seconds) }}s {% elif health.oldest_silence_seconds < 3600 %} {{ '%.0f' | format(health.oldest_silence_seconds / 60) }}m {% else %} {{ '%.1f' | format(health.oldest_silence_seconds / 3600) }}h {% endif %}
{% endif %}