Remove Emma naptime entities and related code
This commit is contained in:
@ -591,38 +591,20 @@
|
||||
{% endmacro %}
|
||||
|
||||
{% macro emma_sleep(type,method) %}
|
||||
{% set asleep = state_attr('input_datetime.emma_down_for_nap','timestamp') | int %}
|
||||
{% set wakeup = state_attr('input_datetime.emma_up_from_nap','timestamp') | int %}
|
||||
{% set day = now().strftime("%-d") %}
|
||||
{% set asleep_day = asleep | timestamp_custom("%-d") %}
|
||||
{% set wakeup_day = wakeup | timestamp_custom("%-d") %}
|
||||
{% if is_state('input_boolean.emma_sleeping','off') and (is_state('input_boolean.emma_has_napped','on') or ((asleep_day == day) and (wakeup > asleep))) %}
|
||||
Emma napped today for {{ custom_time_between('input_datetime.emma_down_for_nap','input_datetime.emma_up_from_nap','hour,minute') }}. She was retrieved from her room at around {{ input_datetime_read('input_datetime.emma_up_from_nap') | trim }}.
|
||||
{% elif (is_state('input_boolean.emma_has_napped','off') and (((asleep_day == day) and (wakeup_day != day)) or wakeup < asleep)) and is_state('input_boolean.emma_sleeping','on') %}
|
||||
Emma is down for nap. She was put down at around {{ input_datetime_read('input_datetime.emma_down_for_nap') | trim }}. She has been asleep for {{ custom_time('input_datetime.emma_down_for_nap','hour,minute') }}.
|
||||
{% elif is_state('input_boolean.emma_sleeping','on') %}
|
||||
{% if is_state('input_boolean.emma_sleeping','on') %}
|
||||
{% if is_state('binary_sensor.early_night_mode','on') %}
|
||||
Emma is asleep for the night. She went to bed at {{ input_datetime_read('input_datetime.emma_asleep_at') | trim }}.
|
||||
{% else %}
|
||||
Emma has not yet awoken for the day. She went to bed at {{ input_datetime_read('input_datetime.emma_asleep_at') | trim }}. Her wakeup time is scheduled for {{ input_datetime_read('input_datetime.emma_wakeup') | trim }}.
|
||||
{% endif %}
|
||||
{% else %}
|
||||
Emma is awake, and does not appear to have napped yet. She woke up at {{ input_datetime_read('input_datetime.emma_awake_at') | trim }}.
|
||||
Emma is awake. She woke up at {{ input_datetime_read('input_datetime.emma_awake_at') | trim }}.
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro emma_sleep_notification(type,method) %}
|
||||
{% set asleep = state_attr('input_datetime.emma_down_for_nap','timestamp') | int %}
|
||||
{% set wakeup = state_attr('input_datetime.emma_up_from_nap','timestamp') | int %}
|
||||
{% set day = now().strftime("%-d") %}
|
||||
{% set asleep_day = asleep | timestamp_custom("%-d") %}
|
||||
{% set wakeup_day = wakeup | timestamp_custom("%-d") %}
|
||||
{% if is_state('input_boolean.emma_sleeping','off') and (is_state('input_boolean.emma_has_napped','on') or ((asleep_day == day) and (wakeup > asleep))) %}
|
||||
Emma has awoken. She napped today for {{ custom_time_between('input_datetime.emma_down_for_nap','input_datetime.emma_up_from_nap','hour,minute') }}. She was retrieved from her room at {{ clock('12-hr') }}
|
||||
{% elif is_state('input_boolean.emma_has_napped','off') and is_state('input_boolean.emma_sleeping','off') and ((asleep_day != day) or (wakeup_day != day)) %}
|
||||
{% if is_state('input_boolean.emma_sleeping','off') %}
|
||||
Emma has awoken for the day at {{ clock('12-hr') }}
|
||||
{% elif is_state('input_boolean.emma_has_napped','off') and ((asleep_day == day) and (wakeup_day != day)) and is_state('input_boolean.emma_sleeping','on') %}
|
||||
Emma is being put down for nap. She was put down at {{ clock('12-hr') }}
|
||||
{% elif is_state('input_boolean.emma_sleeping','on') %}
|
||||
Emma is asleep for the night (or at least, her sleep switch is active) at {{ clock('12-hr') }}
|
||||
{% else %}
|
||||
|
Reference in New Issue
Block a user