{% extends "layout.html" %} {% set active_page = "timer" %} {% set help_page = ["timers", _('Timers')] %} {% block title %} - {{_('Timers')}}{% endblock %} {% block head %} {% endblock %} {% block body %}
{% include 'flash_messages.html' %}

{{_('Timers')}}

{{_('Timers enable relays to be turned on or off for specific durations of time or at specific times of the day.')}}
Note: Timers will only do as instructed, therefore if you turn a relay ON from Start Time to End Time and you want that relay to turn off at the end of that period, you will need to create another timer that turns the relay OFF at End Time + 1 minute.

{{form_timer.csrf_token}}
{{form_timer.name.label(class_='control-label')}}
{{form_timer.name(class_='form-control')}}
{{form_timer.timer_type_output.label(class_='control-label')}}
{%- if displayOrder -%} {%- for order in displayOrder -%} {% for each_timer in timer if each_timer.id == order %}
{{form_timer.csrf_token}} {{form_timer.timer_id(class_='form-control', value=each_timer.id)}}
{{form_timer.name(class_='form-control', value=each_timer.name, **{'title':_('Name')})}}
{%- if each_timer.is_activated %} {{form_timer.deactivate(class_='form-control btn btn-default')}} {%- else %} {{form_timer.activate(class_='form-control btn btn-default')}} {%- endif -%}
{{form_timer.order_up(class_='form-control btn btn-default')}}
{{form_timer.order_down(class_='form-control btn btn-default')}}
{{form_timer.modify(class_='form-control btn btn-default')}}
{{form_timer.delete(class_='form-control btn btn-default',**{'onclick':'return confirm("Are you sure you want to delete this Timer controller?")'})}}
{{form_timer.relay_id.label(class_='control-label')}}
{% if each_timer.timer_type == 'time' %}
{{form_timer.state.label(class_='control-label')}}
{{form_timer.time_start.label(class_='control-label')}}
{{form_timer.time_on_duration(class_='form-control', value=each_timer.duration_on, **{'size':'4'})}}
{% elif each_timer.timer_type == 'timespan' %}
{{form_timer.state.label(class_='control-label')}}
{{form_timer.time_start_duration.label(class_='control-label')}}
{{form_timer.time_end_duration.label(class_='control-label')}}
{% elif each_timer.timer_type == 'duration' %}
{{form_timer.duration_on.label(class_='control-label')}}
{{form_timer.duration_on(class_='form-control', value=each_timer.duration_on, **{'size':'6'})}}
{{form_timer.duration_off.label(class_='control-label')}}
{{form_timer.duration_off(class_='form-control', value=each_timer.duration_off, **{'size':'6'})}}
{% endif %}
{%- endfor -%} {%- endfor -%} {%- endif -%} {% endblock %}