{% if error and not status %}
{{ error }}
{% elif status %}
State {% set state = status.get('measurement_state', 'unknown') if status is mapping else 'unknown' %} {% if state in ('measuring', 'recording') %} Measuring {% elif state == 'paused' %} Paused {% elif state == 'stopped' %} Stopped {% else %} {{ state }} {% endif %}
Lp (dB) {% set lp = status.get('lp') if status is mapping else None %} {% if lp is not none %}{{ "%.1f"|format(lp) }}{% else %}—{% endif %}
Battery {% set batt = status.get('battery_level') if status is mapping else None %} {% if batt is not none %} {{ batt }}% {% else %} {% endif %}
Last Seen {% set last_seen = status.get('last_seen') if status is mapping else None %} {% if last_seen %} {{ last_seen|local_datetime }} {% else %} {% endif %}
{% if unit %}
Unit: {{ unit.id }} {% if unit.slm_model %} • {{ unit.slm_model }}{% endif %} Open Unit →
{% endif %} {% else %}
No status data available.
{% endif %}