{# The dashboard's UPS tile; `ups` comes from web/ups.py ups_tile(). #} {% set u = ups.ups %}
UPS {{ ups.name }}{% if ups.more %} +{{ ups.more }}{% endif %}
{% if u.communication_ok is sameas false %}no contact{% elif u.on_battery %}on battery{% else %}on mains{% endif %}
{% if ups.chart and ups.chart.n > 1 %}{% set lx, ly = (ups.chart.points.split(' ') | last).split(',') %} {% endif %}
{% if u.runtime_min is not none %}{{ u.runtime_min }} min runtime{% endif %}{% if u.load_w is not none %} · {{ u.load_w }} W{% elif u.load_pct is not none %} · {{ u.load_pct }}% load{% endif %}{% if u.charge_pct is not none %} · {{ u.charge_pct }}% charged{% endif %}{% if ups.device %} · details{% endif %}{% if ups.stale %} · last read failed{% endif %}