{# The device page's graphs for a UniFi device; `unifi_stats` comes from web/unifi.py. #} {% set span = 'last 7 days' if unifi_stats.range == '7d' else 'last 24 hours' %}

UniFi statistics · {% for key, title in (('24h', 'last 24 hours'), ('7d', 'last 7 days')) %}{{ title }}{% if not loop.last %} · {% endif %}{% endfor %}

One sample per read of the controller (every {{ config.schedule.infra_interval_s // 60 }} minutes): what the device reported at that moment, not an average over the interval.

{% for g in unifi_stats.graphs %}
{{ g.title }} {{ g.chart.last | round(1) }} {{ g.unit }} now · {{ g.chart.min | round(1) }}–{{ g.chart.max | round(1) }}
{% if g.chart.n > 1 %}{% else %}{% set px, py = g.chart.points.split(',') %}{% endif %}
{% endfor %}