diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 2190956..e097aa2 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -625,17 +625,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): for inner_param, change, data in changes: if change == 'value': if inner_param.opts.get("commands", None) is not None: - ch = param.value() - match inner_param.name(): - case 'Control Method': - pid_enabled = data - getattr(self, f'ch{ch}_t_line').setVisible(pid_enabled) - if pid_enabled: - getattr(self, f'ch{ch}_t_line').setValue(inner_param.child('Set Temperature').value()) - else: - return - case 'Set Temperature': - getattr(self, f'ch{ch}_t_line').setValue(data) + if inner_param.name() == 'Control Method' and not data: + return await asyncio.gather(*[self.client._command(x.format(value=data)) for x in inner_param.opts["commands"]]) elif inner_param.opts.get("param", None) is not None: await asyncio.gather(*[self.client.set_param(*x, data) for x in inner_param.opts["param"]])