Housewide announcement for server maintenance

This commit is contained in:
2023-03-12 20:13:04 -04:00
parent e5c4939cfb
commit 0e4c94eb22
2 changed files with 22 additions and 0 deletions

View File

@ -318,6 +318,15 @@ script:
who: "{{ who if who is defined else 'everywhere' }}" who: "{{ who if who is defined else 'everywhere' }}"
call_we_are_leaving: 1 call_we_are_leaving: 1
server_maintenance_annc:
alias: Server Maintenance Announcement
sequence:
- service: script.status_annc
data:
who: "{{ who if who is defined else 'everywhere' }}"
call_interruption: 1
call_server_maintenance: 1
welcome_home: welcome_home:
alias: 'Welcome Home' alias: 'Welcome Home'
sequence: sequence:

View File

@ -1873,6 +1873,15 @@ script:
</p> </p>
{% endmacro %} {% endmacro %}
{% macro server_maintenance() %}
{{ [
'The server will be going down for maintenance shortly. Prepare to activate caveman mode!',
'We regret to inform you that Home Assistant will be unavailable for a short time. I will advise when it is back.',
'The server in which I live, in your basement, will be going down shortly. I will let you know when I am alive again.',
'The developer has decided that now is the time to perform surgery on my internals. Server going down. Godspeed, humans.'
] | random }}
{% endmacro %}
{# a macro that removes all newline characters, empty spaces, and returns formatted text. Also replaces all Underscores with Spaces #} {# a macro that removes all newline characters, empty spaces, and returns formatted text. Also replaces all Underscores with Spaces #}
{%- macro cleanup(data) -%} {%- macro cleanup(data) -%}
@ -1977,6 +1986,10 @@ script:
{% if call_kallen_dressed_reminder == 1 %} {% if call_kallen_dressed_reminder == 1 %}
{{ kallen_dressed_reminder() }} {{ kallen_dressed_reminder() }}
{% endif %} {% endif %}
{% if call_server_maintenance == 1 %}
{{ server_maintenance() }}
{% endif %}
{%- endmacro -%} {%- endmacro -%}