LiquidGUI [1.0.1.3] Bugfix Release

- Moved device init into dedicated function to prevent unwanted
device re-init.
- Library renaming.
This commit is contained in:
2023-08-19 19:50:26 +01:00
parent 7b32a214df
commit 5487a689a6
2 changed files with 21 additions and 18 deletions
+6 -3
View File
@@ -1,18 +1,21 @@
from liquidctl import find_liquidctl_devices from liquidctl import find_liquidctl_devices
class LiquidCTL_Init(): class LiquidCTL_Helper():
device_name = None device_name = None
device_temp = 0 device_temp = 0
device_fanSpeed = 0 device_fanSpeed = 0
device_pumpSpeed = 0 device_pumpSpeed = 0
device_fwVers = 0 device_fwVers = None
devices = find_liquidctl_devices() devices = find_liquidctl_devices()
for dev in devices: for dev in devices:
with dev.connect(): with dev.connect():
#print(f'{dev.description}') #print(f'{dev.description}')
device_name = dev.description device_name = dev.description
init_status = dev.initialize() device_fwVers = ''.join(map(str, dev.firmware_version))
def ForceInit(self):
init_status = self.dev.initialize()
if init_status: if init_status:
for key, value, unit in init_status: for key, value, unit in init_status:
#print(f'- {key}: {value} {unit}') #print(f'- {key}: {value} {unit}')
+11 -11
View File
@@ -5,8 +5,8 @@ import resources
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QGroupBox from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QGroupBox
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_Helper import LiquidCTL_Helper
from messagehandler import MessageHandler from MessageHandler import MessageHandler
class MainWindow(QMainWindow): class MainWindow(QMainWindow):
def __init__(self): def __init__(self):
@@ -53,17 +53,17 @@ class MainWindow(QMainWindow):
self.timer = QTimer() self.timer = QTimer()
self.timer.setInterval(1000) self.timer.setInterval(1000)
self.timer.timeout.connect(lambda: self.thread_manager.start(lctl_worker.Update)) self.timer.timeout.connect(lambda: self.thread_manager.start(lctl_helper.Update))
self.timer.timeout.connect(self.update_widgets) self.timer.timeout.connect(self.update_widgets)
self.timer.start() self.timer.start()
def update_widgets(self): def update_widgets(self):
self.lbl_device_name.setText(lctl_worker.device_name) self.lbl_device_name.setText(lctl_helper.device_name)
self.prg_temp.setValue(lctl_worker.device_temp) self.prg_temp.setValue(lctl_helper.device_temp)
self.prg_fanSpeed.setValue(lctl_worker.device_fanSpeed) self.prg_fanSpeed.setValue(lctl_helper.device_fanSpeed)
self.prg_pumpSpeed.setValue(lctl_worker.device_pumpSpeed) self.prg_pumpSpeed.setValue(lctl_helper.device_pumpSpeed)
if lctl_worker.device_fwVers != 0 or None: if lctl_helper.device_fwVers != None:
self.lbl_fwVers.setText(f"Firmware: v{lctl_worker.device_fwVers}") self.lbl_fwVers.setText(f"Firmware: v{lctl_helper.device_fwVers}")
app = QApplication(sys.argv) app = QApplication(sys.argv)
icon = QIcon(":/icons/LiquidGUI.ico") icon = QIcon(":/icons/LiquidGUI.ico")
@@ -71,9 +71,9 @@ app.setWindowIcon(icon)
messagehandler = MessageHandler() messagehandler = MessageHandler()
lctl_worker = LiquidCTL_Init() lctl_helper = LiquidCTL_Helper()
# Show error and quit app if no devices are found # Show error and quit app if no devices are found
if lctl_worker.TestConnectionState() == True: if lctl_helper.TestConnectionState() == True:
messagehandler.ShowNoDevicesFoundError() messagehandler.ShowNoDevicesFoundError()
sys.exit(1) sys.exit(1)