{% set form = form_function %} {% set each_device = each_function %} {% set dict_options = dict_controllers[each_function.device] %} {% set unique_id = each_function.unique_id %} {% set controller_type = "Function" %}
{{form_conditional.csrf_token}} {{form_conditional.function_id(value=each_function.unique_id)}} {{form_conditional.function_type(value='function')}}
{% if each_function.device in dict_controllers %}
{% if 'function_manufacturer' in dict_controllers[each_function.device] %}
{{_("Manufacturer")}}: {{dict_controllers[each_function.device]['function_manufacturer']}}
{% endif %} {% if 'function_name' in dict_controllers[each_function.device] %}
{{_("Name")}}: {{dict_controllers[each_function.device]['function_name']}}
{% endif %} {% if 'measurements_name' in dict_controllers[each_function.device] %}
{{_("Measurements")}}: {{dict_controllers[each_function.device]['measurements_name']}}
{% endif %} {% if 'dependencies_module' in dict_controllers[each_function.device] and dict_controllers[each_function.device]['dependencies_module'] %}
{{_("Library")}}: {% for each_lib in dict_controllers[each_function.device]['dependencies_module'] -%} {% if each_lib[0] == 'pip-pypi' %} {% if "==" in each_lib[2] %} {{each_lib[2].split('==')[0]}} {% else %} {{each_lib[2]}} {% endif %} {% elif each_lib[0] == 'internal' %} {{each_lib[2]}} {% else %} {{each_lib[1]}} {% endif %} {%- if not loop.last %}, {% endif %} {% endfor %}
{% endif %} {% set manufacturer_url = 'url_manufacturer' in dict_controllers[each_function.device] and dict_controllers[each_function.device]['url_manufacturer'] %} {% set datasheet_url = 'url_datasheet' in dict_controllers[each_function.device] and dict_controllers[each_function.device]['url_datasheet'] %} {% set product_purchase_url = 'url_product_purchase' in dict_controllers[each_function.device] and dict_controllers[each_function.device]['url_product_purchase'] %} {% set additional_url = 'url_additional' in dict_controllers[each_function.device] and dict_controllers[each_function.device]['url_additional'] %} {% if manufacturer_url or datasheet_url or product_purchase_url or additional_url %}
{{_("Literature") + ": "}} {%- if manufacturer_url -%} {{_("Manufacturer")}} {% for each_url in dict_controllers[each_function.device]['url_manufacturer'] %}Link {{loop.index}}{{ ", " if not loop.last }}{% endfor %} {%- endif -%} {%- if datasheet_url -%} {% if manufacturer_url %}; {% endif -%} {{_("Datasheet")}} {% for each_url in dict_controllers[each_function.device]['url_datasheet'] %}Link {{loop.index}}{{ ", " if not loop.last }}{% endfor %} {%- endif -%} {%- if product_purchase_url -%} {% if manufacturer_url or datasheet_url %}; {% endif -%} {{_("Product")}} {% for each_url in dict_controllers[each_function.device]['url_product_purchase'] %}Link {{loop.index}}{{ ", " if not loop.last }}{% endfor %} {%- endif -%} {%- if additional_url -%} {% if manufacturer_url or datasheet_url or product_purchase_url %}; {% endif -%} {{_("Additional")}} {% for each_url in dict_controllers[each_function.device]['url_additional'] %}Link {{loop.index}}{{ ", " if not loop.last }}{% endfor %} {%- endif -%}.
{% endif %} {% if 'message' in dict_controllers[each_function.device] %}
{{dict_controllers[each_function.device]['message']|safe}}
{% endif %}
{% if 'options_enabled' in dict_controllers[each_function.device] and 'function_status' in dict_controllers[each_function.device]['options_enabled'] %}
{{_('Activated Status')}}
{% endif %} {% if 'function_status' in dict_controllers[each_function.device] and dict_controllers[each_function.device]['function_status'] %}
{{_('Status')}}
{% endif %}
{% if each_function.device in custom_commands %}
{{_('Commands')}}

{% include 'pages/form_options/Custom_Actions_Message.html' %} {% if each_function.device in custom_commands and custom_commands[each_function.device] %} {% set force_default_value = true %} {% set custom_options_values = none %} {% if 'custom_commands' in dict_options %} {% for each_option in dict_options['custom_commands'] %} {% include 'pages/form_options/Custom_Options.html' %} {% endfor %} {% endif %} {% endif %}
{% endif %}
{{_('Options')}}

{{form_function.name.label(class_='control-label')}}
{{form_function.name(class_='form-control', value=each_function.name, **{'title': dict_translation['name']['phrase']})}}
{% if each_function.device != 'function_spacer' %}
{{form_function.log_level_debug.label(class_='control-label')}}
{% endif %} {% include 'pages/form_options/Num_channels.html' %} {% include 'pages/form_options/Measurements_Enabled.html' %} {% set custom_options_values = custom_options_values_controllers %} {% if 'custom_options' in dict_options and custom_options_values[unique_id] %} {% set force_default_value = false %} {% for each_option in dict_options['custom_options'] %} {% include 'pages/form_options/Custom_Options.html' %} {% endfor %} {% endif %}
{% endif %} {%- set function_channel_exists = [] -%} {% for each_function_channel in function_channel if each_function_channel.function_id == unique_id %} {%- do function_channel_exists.append(1) -%} {% endfor %} {% if function_channel_exists %}
{{_('Channel Options')}}

{% endif %} {% set custom_options_values = custom_options_values_function_channels %} {% set force_default_value = true %} {% set channel_options = true %} {% for each_function_channel in function_channel if each_function_channel.function_id == unique_id %} {% set channel = each_function_channel.channel %} {% set name_prefix = each_device.unique_id + "_" + channel|string + "_" %}
Channel {{each_function_channel.channel}} {%- if 'name' in custom_options_values[unique_id][each_function_channel.channel] and custom_options_values[unique_id][each_function_channel.channel]['name'] -%} {{': ' + custom_options_values[unique_id][each_function_channel.channel]['name']}} {%- elif 'channels_dict' in dict_controllers[each_function.device] and 'name' in dict_controllers[each_function.device]['channels_dict'][each_function_channel.channel] -%} {{': ' + dict_controllers[each_function.device]['channels_dict'][each_function_channel.channel]['name']}} {%- endif -%}
{% if custom_options_values[unique_id] %} {% if 'custom_channel_options_message' in dict_options %}
{{dict_options['custom_channel_options_message']|safe}}
{% endif %} {% if 'custom_channel_options' in dict_options %}
{% for each_option in dict_options['custom_channel_options'] %} {% include 'pages/form_options/Custom_Options.html' %} {% endfor %}
{% endif %} {% endif %} {% endfor %} {% if ("options_disabled" in dict_options and ('measurements_select' not in dict_options['options_disabled'] and 'measurements_configure' not in dict_options['options_disabled'])) or "options_disabled" not in dict_options %} {% set show_measurement_settings = true %} {% endif %} {% if show_measurement_settings %}
{{_('Measurement Settings')}}

{% if "measurements_variable_amount" in dict_options and dict_options['measurements_variable_amount'] %} {% include 'pages/form_options/Measurements_Select.html' %} {% endif %} {% include 'pages/form_options/Measurements_Configure.html' %} {% endif %}
{% if 'enable_actions' in dict_options['options_enabled']%}
{{_('Actions')}}
{{form_actions.csrf_token}} {{form_actions.device_id(class_='form-control', value=each_function.unique_id)}} {{form_actions.function_type(class_='form-control', value='function')}}
{% set channel_options = false %} {% set post_action = "/function" %}
{% for each_action in action if each_action.function_id == each_function.unique_id %} {% include 'pages/actions.html' %} {% endfor %}
{% endif %}