diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 2393d0a..e6172b2 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -266,7 +266,7 @@ class MainWindow(QtWidgets.QMainWindow): for inner_param, change, data in changes: if change == "value": - if inner_param.opts.get("param", None) is not None: + if "param" in inner_param.opts: if inner_param.opts.get("suffix", None) == "mA": data /= 1000 # Given in mA @@ -282,13 +282,13 @@ class MainWindow(QtWidgets.QMainWindow): await self.client.set_param(*set_param_args) param.child(*param.childPath(inner_param)).setOpts(lock=False) - if inner_param.opts.get("pid_autotune", None) is not None: + if "pid_autotune" in inner_param.opts: auto_tuner_param = inner_param.opts["pid_autotune"][0] if inner_param.opts["pid_autotune"][1] != "ch": ch = inner_param.opts["pid_autotune"][1] self.autotuners.set_params(auto_tuner_param, ch, data) - if inner_param.opts.get("activaters", None) is not None: + if "activaters" in inner_param.opts: activater = inner_param.opts["activaters"][ inner_param.opts["limits"].index(data) ]