Commit 3d567b89 authored by Jerome Carnis's avatar Jerome Carnis 🦊
Browse files

deviceMethodWidget.py: fix mypy complaints

parent f0ae1824
Pipeline #28256 passed with stages
in 9 minutes and 33 seconds
......@@ -40,7 +40,7 @@ class DeviceMethodWidget(Ui_Form, DeviceWidget, StackableWidget):
parent=None,
):
self.method = method
self.value_controls = ()
self.value_controls: Tuple[QWidget, ...] = ()
DeviceWidget.__init__(
self, device, model_image=model_image, config=config, parent=parent
)
......@@ -287,24 +287,26 @@ class MethodEnabledByAttributeWidget(DeviceMethodEnabledWidget):
# emit a signal each time the external trigger value is changed
# callback(attribute_object[key_filter]) is called
self.device.attach_attribute_callback(
attribute=ATTR_EXTERNAL_TRIGGER,
callback=self.sig_control_changed.emit,
key_filter=VALUE,
)
# define the status of the input field using the current value of the attribute
self.control_changed(self.device.get_value(ATTR_EXTERNAL_TRIGGER))
# create the checkbox for the attribute
control_widget = AttributeDeviceDisplayWidget(
device=self.external_device_attribute[0],
attribute=self.external_device_attribute[1],
)
self.widget_holder.layout().insertWidget(3, control_widget)
if self.device is not None:
self.device.attach_attribute_callback(
attribute=ATTR_EXTERNAL_TRIGGER,
callback=self.sig_control_changed.emit,
key_filter=VALUE,
)
# define the status of the input field
# using the current value of the attribute
self.control_changed(self.device.get_value(ATTR_EXTERNAL_TRIGGER))
# create the checkbox for the attribute
control_widget = AttributeDeviceDisplayWidget(
device=self.external_device_attribute[0],
attribute=self.external_device_attribute[1],
)
self.widget_holder.layout().insertWidget(3, control_widget)
self.set_status_label(self.device.get_value(ATTR_STATUS))
self.value_controls = (self.input_value,)
self.set_status_label(self.device.get_value(ATTR_STATUS))
self.value_controls = (self.input_value,)
class DeviceSimpleMethodsListWidget(DeviceMethodWidget):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment