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

View File

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