Move "services down" to a macro for possible re-use elsewhere

Also improved the wording
This commit is contained in:
2024-12-10 16:03:07 -05:00
parent 6c145f0ca9
commit 6b9380f015
2 changed files with 13 additions and 4 deletions

View File

@ -6,6 +6,7 @@
{% from 'speech.jinja' import greeting, today_is, sun_status %}
{% from 'weather.jinja' import weatherReport %}
{% from 'sports.jinja' import sports_updates %}
{% from 'server.jinja' import services_down %}
<p>
{{ greeting('date') }}
</p>
@ -22,10 +23,7 @@
</p>
<p>
There are {{ states('sensor.services_down') }} services currently offline.
{% if states('sensor.services_down') | int > 0 %}
They are {{ state_attr('sensor.services_down','services') }}.
{% endif %}
{{ services_down() }}
</p>
<p>