Macro updates
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
{% macro emma_sleep() %}
|
||||
{% from 'time.jinja' import input_datetime_12hr_with_date %}
|
||||
{% from 'time.jinja' import input_datetime_12hr_with_date, input_datetime_12hr %}
|
||||
{% from 'easy_time.jinja' import custom_time, custom_time_between %}
|
||||
{% set asleep = state_attr('input_datetime.emma_down_for_nap','timestamp') | int %}
|
||||
{% set wakeup = state_attr('input_datetime.emma_up_from_nap','timestamp') | int %}
|
||||
@ -17,7 +17,7 @@
|
||||
Emma has not yet awoken for the day.
|
||||
{% endif %}
|
||||
{% else %}
|
||||
Emma is awake, and does not appear to have napped yet today.
|
||||
Emma is awake, and does not appear to have napped yet. She woke up at {{ input_datetime_12hr('input_datetime.emma_wakeup') }} today.
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
@ -54,8 +54,6 @@
|
||||
'This is absolutely essential, and I will remind him to do it at',
|
||||
'Since nobody including Tony himself likes him without his meds, I will remind him at',
|
||||
] | random }} {{ input_datetime_12hr('input_datetime.tony_morning_meds_notify') }} today.
|
||||
{% else %}
|
||||
There are no further notifications scheduled for him today.
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
@ -95,8 +93,6 @@
|
||||
'Rest assured that I will pester him mercilessly about this, starting at',
|
||||
'This is absolutely essential, and I will remind him to do it at',
|
||||
] | random }} {{ input_datetime_12hr('input_datetime.kallen_morning_meds_notify') }} today.
|
||||
{% else %}
|
||||
There are no further notifications scheduled for him today.
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
@ -2,12 +2,12 @@
|
||||
{{ (states(input_number)) | int * 60 }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro current_time_12hr() %}
|
||||
{% macro current_time(hr) %}
|
||||
{% if hr == 12 %}
|
||||
{{ now().strftime('%-I:%M %p') }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro current_time_24hr() %}
|
||||
{% elif hr == 24 %}
|
||||
{{ now().strftime('%H:%M') }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro current_date_input() %}
|
||||
|
@ -682,6 +682,17 @@ script:
|
||||
# Lighting
|
||||
- variables:
|
||||
brightness: "{{ state_attr('switch.adaptive_lighting_emma_bedroom','brightness_pct') }}"
|
||||
- if:
|
||||
- condition: template
|
||||
value_template: "{{ is_state('binary_sensor.morning','on') or is_state('binary_sensor.midday','on') }}"
|
||||
then:
|
||||
- service: input_datetime.set_datetime
|
||||
target:
|
||||
entity_id: input_datetime.emma_wakeup
|
||||
data:
|
||||
time: >
|
||||
{% from 'time.jinja' import current_time %}
|
||||
{{ current_time(24) }}
|
||||
- if:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.early_night_mode
|
||||
|
@ -1,7 +1,7 @@
|
||||
>
|
||||
{# Kallen Morning Briefing #}
|
||||
{%- macro getReport() -%}
|
||||
{% from 'time.jinja' import current_time_12hr, current_date_readout, input_datetime_12hr %}
|
||||
{% from 'time.jinja' import current_time, current_date_readout, input_datetime_12hr %}
|
||||
{% from 'speech.jinja' import dadjoke, inspirational_quote %}
|
||||
{% from 'easy_time.jinja' import count_the_day, custom_time %}
|
||||
<p>
|
||||
@ -10,7 +10,7 @@
|
||||
{% if is_state('binary_sensor.morning','on') %}
|
||||
<s>Today is {{ current_date_readout() }}.</s>
|
||||
{% else %}
|
||||
<s>It is {{ current_time_12hr() }}.</s>
|
||||
<s>It is {{ current_time(12) }}.</s>
|
||||
{% endif %}
|
||||
|
||||
{% if is_state('sensor.anniversary_kallen_s_birthday', '0') %}
|
||||
|
Reference in New Issue
Block a user