diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index 8f82881..c786e3a 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -118,15 +118,15 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): self.ip_set_line.setEnabled(not result) self.port_set_spin.setEnabled(not result) self.connect_btn.setText("Disconnect" if result else "Connect") - if not result: + if result: + self.client_watcher.start_watching() + self._status(await self.tec_client.hw_rev()) + self.fan_update(await self.tec_client.fan()) + else: self.status_lbl.setText("Disconnected") self.fan_pwm_warning.setPixmap(QtGui.QPixmap()) self.fan_pwm_warning.setToolTip("") self.client_watcher.stop_watching() - else: - self.client_watcher.start_watching() - self._status(await self.tec_client.hw_rev()) - self.fan_update(await self.tec_client.fan()) def _set_fan_pwm_warning(self): if self.fan_power_slider.value() != 100: