Improved macros for telling current time from input_datetime entities
This commit is contained in:
@ -3,11 +3,15 @@
|
||||
{% endmacro %}
|
||||
|
||||
{% macro current_time_12hr() %}
|
||||
{{ now().strftime("%I:%M %p") }}
|
||||
{{ now().strftime("%-I:%M %p") }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro input_datetime_12hr(entity) %}
|
||||
{{ state_attr(entity,'timestamp') | int | timestamp_custom('%I:%M %p', False) }}
|
||||
{{ state_attr(entity,'timestamp') | int | timestamp_custom('%-I:%M %p', False) }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro input_datetime_12hr_with_date(entity) %}
|
||||
{{ state_attr(entity,'timestamp') | int | timestamp_custom('%-I:%M %p') }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro current_date_readout() %}
|
||||
|
Reference in New Issue
Block a user