{# plugins/homeassistant/templates/homeassistant/index.html — whether Home Assistant answers, which updates are waiting with Install beside each, how its backups stand, and the updates Steward has run. Refreshes itself while one is under way. #} {% extends "base.html" %} {% from "_macros.html" import page_header, status_badge, stat_tile, empty_state %} {% block title %}Home Assistant — Steward{% endblock %} {% block content %} {% set admin = session.user_role == 'admin' %} {% call page_header("Home Assistant", connection.url if connection else none) %} {% if admin and connection %}Connection{% endif %} {% endcall %} {% if not connection %} {% if error %}{% endif %}
{{ empty_state("Not connected. Sign in to a Home Assistant instance to see its waiting updates and backups, and to install updates after a confirmed backup.", "Connect" if admin else none, "/plugins/homeassistant/connection") }}
{% else %} {% if error %}{% endif %}

{% if under_way %}{{ status_badge('pending', 'Updating') }} {{ under_way.title }}: {{ "taking a backup first" if under_way.state == 'backing_up' else "installing " ~ under_way.to_version }}. Home Assistant may stop answering for a while. {% elif reach == 'up' %}{{ status_badge('up', 'Answering') }} {% if installable %}{{ installable|length }} update{{ "s" if installable|length != 1 }} waiting.{% else %}Everything Steward can update is up to date.{% endif %} Read {{ connection.last_polled_at|ago }}. {% elif reach == 'down' %}{{ status_badge('down', 'Not answering') }} {{ says }} {% if connection.last_ok_at %}Last answered {{ connection.last_ok_at|ago }}; what's below is from then.{% endif %} {% if admin and connection.refused %}

{{ csrf_field() }}
{% endif %} {% else %}{{ status_badge('pending', 'Not read yet') }} {{ says }}{% endif %}

{% if not connection.can_install %}

The Home Assistant user who signed in isn't an administrator, so updates can't be installed from here. {% if admin %}Sign in again as an administrator to install them.{% endif %}

{% endif %}
{{ stat_tile("Updates waiting", installable|length if connection.last_ok_at else "—") }} {{ stat_tile("Last good backup", (backup_at|ago) if backup_at else "—", state="degraded" if backup_tone == 'warn' else none) }} {{ stat_tile("Next backup", (backup_next|ago) if backup_next else "—") }}

{{ backup_says }}

Updates

{% if installable %} {% if admin %}{% endif %} {% for u in installable %} {% if admin %}{% endif %} {% endfor %}
WhatNowNew
{{ u.title }}
{{ u.kind_word }}{% if u.auto_update %}, updates itself{% endif %}
{{ u.installed or "—" }} {% if u.release_url %}{{ u.latest or "—" }}{% else %}{{ u.latest or "—" }}{% endif %} {% if connection.can_install and not under_way and not connection.refused and not u.in_progress %}
{{ csrf_field() }}
{% endif %}
{% else %}

Nothing waiting.

{% endif %} {% if current %}

Up to date: {% for u in current %}{{ u.title }} {{ u.installed }}{{ ", " if not loop.last }}{% endfor %}.

{% endif %} {% if others %}

Waiting, for Home Assistant to install: {% for u in others %}{{ u.title }}{{ ", " if not loop.last }}{% endfor %}. Steward installs Core, OS and add-on updates only.

{% endif %}
{% if runs %}

Updates run from Steward

{% for r in runs %} {% endfor %}
WhatVersionsOutcomeStarted
{{ r.title }}
by {{ r.started_by or "Steward" }}
{{ r.from_version or "—" }} → {{ r.to_version or "—" }} {% if r.state == 'done' %}{{ status_badge('up', 'Done') }} {% elif r.state == 'failed' %}{{ status_badge('down', 'Failed') }}
{{ r.message }}
{% else %}{{ status_badge('pending', 'Taking a backup' if r.state == 'backing_up' else 'Installing') }}{% endif %}
{{ r.started_at|ago }}
{% endif %}
{% endif %} {% endblock %}