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():
|
class LiquidCTL_Init():
|
||||||
device_name = None
|
device_name = None
|
||||||
@@ -34,4 +34,10 @@ class LiquidCTL_Init():
|
|||||||
elif key == "Fan speed":
|
elif key == "Fan speed":
|
||||||
self.device_fanSpeed = value
|
self.device_fanSpeed = value
|
||||||
elif key == "Pump speed":
|
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 qdarktheme
|
||||||
import win32mica
|
import win32mica
|
||||||
import resources
|
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.QtCore import Qt, QTimer, QThreadPool
|
||||||
from PySide6.QtGui import QFont, QIcon
|
from PySide6.QtGui import QFont, QIcon
|
||||||
from liquidctl_worker import LiquidCTL_Init
|
from liquidctl_worker import LiquidCTL_Init
|
||||||
@@ -12,7 +12,7 @@ class MainWindow(QMainWindow):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(MainWindow, self).__init__()
|
super(MainWindow, self).__init__()
|
||||||
self.setWindowTitle("LiquidGUI (v.1.0.1.2)")
|
self.setWindowTitle("LiquidGUI (v.1.0.1.2)")
|
||||||
self.setFixedSize(450, 300)
|
self.setFixedSize(450, 350)
|
||||||
self.setWindowFlags(Qt.WindowType.Dialog)
|
self.setWindowFlags(Qt.WindowType.Dialog)
|
||||||
widget = QWidget(self)
|
widget = QWidget(self)
|
||||||
|
|
||||||
@@ -32,6 +32,8 @@ class MainWindow(QMainWindow):
|
|||||||
self.prg_pumpSpeed = QProgressBar(format="%v rpm",
|
self.prg_pumpSpeed = QProgressBar(format="%v rpm",
|
||||||
minimum=1900,
|
minimum=1900,
|
||||||
maximum=2700)
|
maximum=2700)
|
||||||
|
self.btn_maxFanSpeed = QPushButton(text="Max Fan Speed")
|
||||||
|
self.btn_maxFanSpeed.clicked.connect(self.max_fan_speed)
|
||||||
self.lbl_fwVers = QLabel()
|
self.lbl_fwVers = QLabel()
|
||||||
|
|
||||||
layout = QVBoxLayout(widget)
|
layout = QVBoxLayout(widget)
|
||||||
@@ -43,6 +45,7 @@ class MainWindow(QMainWindow):
|
|||||||
layout.addWidget(self.lbl_pumpSpeed)
|
layout.addWidget(self.lbl_pumpSpeed)
|
||||||
layout.addWidget(self.prg_pumpSpeed)
|
layout.addWidget(self.prg_pumpSpeed)
|
||||||
layout.addWidget(self.lbl_fwVers)
|
layout.addWidget(self.lbl_fwVers)
|
||||||
|
layout.addWidget(self.btn_maxFanSpeed)
|
||||||
layout.setSpacing(10)
|
layout.setSpacing(10)
|
||||||
|
|
||||||
self.setLayout(layout)
|
self.setLayout(layout)
|
||||||
@@ -64,6 +67,9 @@ class MainWindow(QMainWindow):
|
|||||||
self.prg_pumpSpeed.setValue(lctl_worker.device_pumpSpeed)
|
self.prg_pumpSpeed.setValue(lctl_worker.device_pumpSpeed)
|
||||||
if lctl_worker.device_fwVers != 0 or None:
|
if lctl_worker.device_fwVers != 0 or None:
|
||||||
self.lbl_fwVers.setText(f"Firmware: v{lctl_worker.device_fwVers}")
|
self.lbl_fwVers.setText(f"Firmware: v{lctl_worker.device_fwVers}")
|
||||||
|
|
||||||
|
def max_fan_speed(self):
|
||||||
|
lctl_worker.SetFanSpeed(100)
|
||||||
|
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
icon = QIcon(":/icons/LiquidGUI.ico")
|
icon = QIcon(":/icons/LiquidGUI.ico")
|
||||||
|
|||||||
Reference in New Issue
Block a user