Swap order connected first

This commit is contained in:
atse 2023-07-20 16:16:57 +08:00
parent 04a8f5ea56
commit b8d0cdabd3
1 changed files with 5 additions and 5 deletions

View File

@ -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: