set_datetime now accepts seconds
This commit is contained in:
@ -38,8 +38,10 @@
|
|||||||
{{ as_timestamp(strptime(state_attr(calendar,start_or_end), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%I:%M %p") }}
|
{{ as_timestamp(strptime(state_attr(calendar,start_or_end), '%Y-%m-%d %H:%M:%S')) | timestamp_custom("%I:%M %p") }}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro set_datetime(hours,minutes) %}
|
{% macro set_datetime(hours,minutes,seconds) %}
|
||||||
{% if minutes is defined %}
|
{% if seconds is defined %}
|
||||||
|
{{ (as_timestamp(now()) + ((((hours * 60) * 60) + (minutes * 60))) + seconds) | int | timestamp_custom('%Y-%m-%d %H:%M:%S') }}
|
||||||
|
{% elif minutes is defined %}
|
||||||
{{ (as_timestamp(now()) + (((hours * 60) * 60) + (minutes * 60))) | int | timestamp_custom('%Y-%m-%d %H:%M:%S') }}
|
{{ (as_timestamp(now()) + (((hours * 60) * 60) + (minutes * 60))) | int | timestamp_custom('%Y-%m-%d %H:%M:%S') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ (as_timestamp(now()) + ((hours* 60) * 60)) | int | timestamp_custom('%Y-%m-%d %H:%M:%S') }}
|
{{ (as_timestamp(now()) + ((hours* 60) * 60)) | int | timestamp_custom('%Y-%m-%d %H:%M:%S') }}
|
||||||
|
Reference in New Issue
Block a user