LiquidGUI [1.1.0.0] DEV
- Implemented the ability to change fan speed. - Placeholder GUI button to max out fan speed.
This commit is contained in:
+8
-2
@@ -1,4 +1,4 @@
|
||||
from liquidctl import find_liquidctl_devices
|
||||
from liquidctl import find_liquidctl_devices, cli
|
||||
|
||||
class LiquidCTL_Init():
|
||||
device_name = None
|
||||
@@ -34,4 +34,10 @@ class LiquidCTL_Init():
|
||||
elif key == "Fan speed":
|
||||
self.device_fanSpeed = value
|
||||
elif key == "Pump speed":
|
||||
self.device_pumpSpeed = value
|
||||
self.device_pumpSpeed = value
|
||||
|
||||
def SetFanSpeed(self, speed):
|
||||
with self.dev.connect():
|
||||
cli._device_set_speed(self.dev, args={"<temperature>": [],
|
||||
"<channel>": "fan",
|
||||
"<percentage>": [str(speed)]})
|
||||
@@ -2,7 +2,7 @@ import sys
|
||||
import qdarktheme
|
||||
import win32mica
|
||||
import resources
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QGroupBox
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QPushButton
|
||||
from PySide6.QtCore import Qt, QTimer, QThreadPool
|
||||
from PySide6.QtGui import QFont, QIcon
|
||||
from liquidctl_worker import LiquidCTL_Init
|
||||
@@ -12,7 +12,7 @@ class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super(MainWindow, self).__init__()
|
||||
self.setWindowTitle("LiquidGUI (v.1.0.1.2)")
|
||||
self.setFixedSize(450, 300)
|
||||
self.setFixedSize(450, 350)
|
||||
self.setWindowFlags(Qt.WindowType.Dialog)
|
||||
widget = QWidget(self)
|
||||
|
||||
@@ -32,6 +32,8 @@ class MainWindow(QMainWindow):
|
||||
self.prg_pumpSpeed = QProgressBar(format="%v rpm",
|
||||
minimum=1900,
|
||||
maximum=2700)
|
||||
self.btn_maxFanSpeed = QPushButton(text="Max Fan Speed")
|
||||
self.btn_maxFanSpeed.clicked.connect(self.max_fan_speed)
|
||||
self.lbl_fwVers = QLabel()
|
||||
|
||||
layout = QVBoxLayout(widget)
|
||||
@@ -43,6 +45,7 @@ class MainWindow(QMainWindow):
|
||||
layout.addWidget(self.lbl_pumpSpeed)
|
||||
layout.addWidget(self.prg_pumpSpeed)
|
||||
layout.addWidget(self.lbl_fwVers)
|
||||
layout.addWidget(self.btn_maxFanSpeed)
|
||||
layout.setSpacing(10)
|
||||
|
||||
self.setLayout(layout)
|
||||
@@ -64,6 +67,9 @@ class MainWindow(QMainWindow):
|
||||
self.prg_pumpSpeed.setValue(lctl_worker.device_pumpSpeed)
|
||||
if lctl_worker.device_fwVers != 0 or None:
|
||||
self.lbl_fwVers.setText(f"Firmware: v{lctl_worker.device_fwVers}")
|
||||
|
||||
def max_fan_speed(self):
|
||||
lctl_worker.SetFanSpeed(100)
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
icon = QIcon(":/icons/LiquidGUI.ico")
|
||||
|
||||
Reference in New Issue
Block a user