Handle UI when fan_pwm is 0

This commit is contained in:
atse 2023-07-11 11:48:38 +08:00
parent ac77c457ec
commit 9f839f4bd9
1 changed files with 1 additions and 1 deletions

View File

@ -123,7 +123,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
if fan_settings is None: if fan_settings is None:
return return
with QSignalBlocker(self.fan_power_slider): with QSignalBlocker(self.fan_power_slider):
self.fan_power_slider.setValue(fan_settings["fan_pwm"]) 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"]) self.fan_power_slider.setEnabled(not fan_settings["auto_mode"])
with QSignalBlocker(self.fan_auto_box): with QSignalBlocker(self.fan_auto_box):
self.fan_auto_box.setChecked(fan_settings["auto_mode"]) self.fan_auto_box.setChecked(fan_settings["auto_mode"])