More time-based Jinja2 custom templates
This commit is contained in:
@ -6,6 +6,10 @@
|
||||
{{ now().strftime("%I:%M %p") }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro input_datetime_12hr(entity) %}
|
||||
{{ state_attr(entity,'timestamp') | int | timestamp_custom('%I:%M %p', False) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro current_date_readout() %}
|
||||
{{ states('sensor.today_is') }}, {{ as_timestamp(now()) | timestamp_custom('%B %d %Y') }}
|
||||
{% endmacro %}
|
||||
@ -16,4 +20,8 @@
|
||||
|
||||
{% macro set_time_from_calendar(calendar,start_or_end) %}
|
||||
{{ as_timestamp(strptime(state_attr(calendar,start_or_end), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%H:%M") }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro read_time_from_calendar(calendar,start_or_end) %}
|
||||
{{ as_timestamp(strptime(state_attr(calendar,start_or_end), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%I:%M %p") }}
|
||||
{% endmacro %}
|
Reference in New Issue
Block a user