diff --git a/mycodo/widgets/widget_measurement_multi.py b/mycodo/widgets/widget_measurement_multi.py index a768b8291..0e3048f45 100644 --- a/mycodo/widgets/widget_measurement_multi.py +++ b/mycodo/widgets/widget_measurement_multi.py @@ -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': [ { @@ -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 -%} """ }