fix datetime usage
This commit is contained in:
@@ -218,7 +218,7 @@ variables:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
remote_temperature_last_change: >
|
remote_temperature_last_change: >
|
||||||
{% if remote_temperature_entity and states(remote_temperature_entity) not in ['unknown', 'unavailable', none] %}
|
{% if remote_temperature_entity and states(remote_temperature_entity) not in ['unknown', 'unavailable', none] %}
|
||||||
{{ states[remote_temperature_entity].last_changed }}
|
{{ as_datetime(states[remote_temperature_entity].last_changed) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ none }}
|
{{ none }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -322,12 +322,12 @@ variables:
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
override_last_change: >
|
override_last_change: >
|
||||||
{% if setpoint_change_source_entity and states(setpoint_change_source_entity) not in ['unknown', 'unavailable', none] %}
|
{% if setpoint_change_source_entity and states(setpoint_change_source_entity) not in ['unknown', 'unavailable', none] %}
|
||||||
{{ states[setpoint_change_source_entity].last_updated }}
|
{{ as_datetime(states[setpoint_change_source_entity].last_updated) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ none }}
|
{{ none }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
override_duration_exceeded: >
|
override_duration_exceeded: >
|
||||||
{% if override_last_change and override_reset_duration_seconds > 0 and setpoint_change_source_entity and states(setpoint_change_source_entity) == 'manual' %}
|
{% if override_last_change != none and override_reset_duration_seconds > 0 and setpoint_change_source_entity and states(setpoint_change_source_entity) == 'manual' %}
|
||||||
{% set elapsed = (now() - override_last_change).total_seconds() %}
|
{% set elapsed = (now() - override_last_change).total_seconds() %}
|
||||||
{{ elapsed > override_reset_duration_seconds }}
|
{{ elapsed > override_reset_duration_seconds }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
Reference in New Issue
Block a user