Skip to content

Commit

Permalink
adjust widget dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Aug 18, 2024
1 parent 03fc012 commit 561b3a1
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions mycodo/widgets/widget_measurement_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

'message': 'Displays two measurement values and timestamps.',

'widget_width': 4,
'widget_height': 7,
'widget_width': 5,
'widget_height': 8,

'custom_options': [
{
Expand Down Expand Up @@ -310,60 +310,53 @@
{%- set measurement_id_1 = widget_options['measurement_1'].split(",")[1] -%}
{%- set device_id_2 = widget_options['measurement_2'].split(",")[0] -%}
{%- set measurement_id_2 = widget_options['measurement_2'].split(",")[1] -%}
{% for each_input in input %}
{% if each_input.unique_id == device_id_1 %}
getLastDataMeasurement('1', '{{each_widget.unique_id}}', '{{each_input.unique_id}}', 'input', '{{measurement_id_1}}', {{widget_options['measurement_1_max_age']}}, {{widget_options['decimal_places_1']}});
repeatLastDataMeasurement('1', '{{each_widget.unique_id}}', '{{each_input.unique_id}}', 'input', '{{measurement_id_1}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_1_max_age']}}, {{widget_options['decimal_places_1']}});
{%- endif -%}
{% if each_input.unique_id == device_id_2 %}
getLastDataMeasurement('2', '{{each_widget.unique_id}}', '{{each_input.unique_id}}', 'input', '{{measurement_id_2}}', {{widget_options['measurement_2_max_age']}}, {{widget_options['decimal_places_2']}});
repeatLastDataMeasurement('2', '{{each_widget.unique_id}}', '{{each_input.unique_id}}', 'input', '{{measurement_id_2}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_2_max_age']}}, {{widget_options['decimal_places_2']}});
{% endif %}
{%- endfor -%}
{% for each_function in function %}
{% if each_function.unique_id == device_id_1 %}
getLastDataMeasurement('1', '{{each_widget.unique_id}}', '{{each_function.unique_id}}', 'function', '{{measurement_id_1}}', {{widget_options['measurement_1_max_age']}}, {{widget_options['decimal_places_1']}});
repeatLastDataMeasurement('1', '{{each_widget.unique_id}}', '{{each_function.unique_id}}', 'function', '{{measurement_id_1}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_1_max_age']}}, {{widget_options['decimal_places_1']}});
{% endif %}
{% if each_function.unique_id == device_id_2 %}
getLastDataMeasurement('2', '{{each_widget.unique_id}}', '{{each_function.unique_id}}', 'function', '{{measurement_id_2}}', {{widget_options['measurement_2_max_age']}}, {{widget_options['decimal_places_2']}});
repeatLastDataMeasurement('2', '{{each_widget.unique_id}}', '{{each_function.unique_id}}', 'function', '{{measurement_id_2}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_2_max_age']}}, {{widget_options['decimal_places_2']}});
{% endif %}
{%- endfor -%}
{% for each_output in output %}
{% if each_output.unique_id == device_id_1 %}
getLastDataMeasurement('1', '{{each_widget.unique_id}}', '{{each_output.unique_id}}', 'output', '{{measurement_id_1}}', {{widget_options['measurement_1_max_age']}}, {{widget_options['decimal_places_1']}});
repeatLastDataMeasurement('1', '{{each_widget.unique_id}}', '{{each_output.unique_id}}', 'output', '{{measurement_id_1}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_1_max_age']}}, {{widget_options['decimal_places_1']}});
{% endif %}
{% if each_output.unique_id == device_id_2 %}
getLastDataMeasurement('2', '{{each_widget.unique_id}}', '{{each_output.unique_id}}', 'output', '{{measurement_id_2}}', {{widget_options['measurement_2_max_age']}}, {{widget_options['decimal_places_2']}});
repeatLastDataMeasurement('2', '{{each_widget.unique_id}}', '{{each_output.unique_id}}', 'output', '{{measurement_id_2}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_2_max_age']}}, {{widget_options['decimal_places_2']}});
{% endif %}
{%- endfor -%}
{% for each_pid in pid %}
{% if each_pid.unique_id == device_id_1 %}
getLastDataMeasurement('1', '{{each_widget.unique_id}}', '{{each_pid.unique_id}}', 'pid', '{{measurement_id_1}}', {{widget_options['measurement_1_max_age']}}, {{widget_options['decimal_places_1']}});
repeatLastDataMeasurement('1', '{{each_widget.unique_id}}', '{{each_pid.unique_id}}', 'pid', '{{measurement_id_1}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_1_max_age']}}, {{widget_options['decimal_places_1']}});
{% endif %}
{% if each_pid.unique_id == device_id_2 %}
getLastDataMeasurement('2', '{{each_widget.unique_id}}', '{{each_pid.unique_id}}', 'pid', '{{measurement_id_2}}', {{widget_options['measurement_2_max_age']}}, {{widget_options['decimal_places_2']}});
repeatLastDataMeasurement('2', '{{each_widget.unique_id}}', '{{each_pid.unique_id}}', 'pid', '{{measurement_id_2}}', {{widget_options['refresh_seconds']}}, {{widget_options['measurement_2_max_age']}}, {{widget_options['decimal_places_2']}});
{% endif %}
{%- endfor -%}
"""
}

0 comments on commit 561b3a1

Please sign in to comment.