forked from M-Labs/thermostat
Disable auto fan box if adjusted while auto
This commit is contained in:
parent
71076510a2
commit
e5b0583a91
|
@ -151,7 +151,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
return
|
||||
with QSignalBlocker(self.fan_power_slider):
|
||||
self.fan_power_slider.setValue(fan_settings["fan_pwm"] or 100) # 0 = PWM off = full strength
|
||||
self.fan_power_slider.setEnabled(not fan_settings["auto_mode"])
|
||||
with QSignalBlocker(self.fan_auto_box):
|
||||
self.fan_auto_box.setChecked(fan_settings["auto_mode"])
|
||||
if not self.fan_pwm_recommended:
|
||||
|
@ -159,8 +158,11 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
|
||||
@asyncSlot(int)
|
||||
async def fan_set(self, value):
|
||||
if not self.tec_client.is_connected() or self.fan_auto_box.isChecked():
|
||||
if not self.tec_client.is_connected():
|
||||
return
|
||||
if self.fan_auto_box.isChecked():
|
||||
with QSignalBlocker(self.fan_auto_box):
|
||||
self.fan_auto_box.setChecked(False)
|
||||
await self.tec_client.set_param("fan", value)
|
||||
if not self.fan_pwm_recommended:
|
||||
self._set_fan_pwm_warning()
|
||||
|
@ -169,7 +171,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||
async def fan_auto_set(self, enabled):
|
||||
if not self.tec_client.is_connected():
|
||||
return
|
||||
self.fan_power_slider.setEnabled(not enabled)
|
||||
if enabled:
|
||||
await self.tec_client.set_param("fan", "auto")
|
||||
self.fan_update(await self.tec_client.fan())
|
||||
|
|
Loading…
Reference in New Issue