LiquidGUI [1.3.0.0]
- Lots of refactoring.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import subprocess
|
||||
import re
|
||||
from liquidctl_helper_interface import LiquidCTL_Helper_Interface
|
||||
|
||||
class LiquidCTL_Helper(LiquidCTL_Helper_Interface):
|
||||
device_name: str = ""
|
||||
device_temp = 0
|
||||
device_fanSpeed = 0
|
||||
device_pumpSpeed = 0
|
||||
device_fwVers = None
|
||||
|
||||
devices = None
|
||||
|
||||
def ForceInit(self):
|
||||
NotImplemented
|
||||
|
||||
def TestConnectionState(self):
|
||||
output = subprocess.run(["liquidctl", "status"], stdout=subprocess.PIPE, universal_newlines=True)
|
||||
if len(output.stdout) > 0:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def Update(self):
|
||||
output = subprocess.run(["liquidctl", "status"], stdout=subprocess.PIPE, universal_newlines=True)
|
||||
self.device_name = str(re.search(r'^[^\n]*', output.stdout).group(0))
|
||||
self.device_temp = float(re.search(r'Liquid temperature\s+(\d+\.?\d*)', output.stdout).group(1))
|
||||
self.device_fanSpeed = int(re.search(r'Fan speed\s+(\d+)', output.stdout).group(1))
|
||||
self.device_pumpSpeed = int(re.search(r'Pump speed\s+(\d+)', output.stdout).group(1))
|
||||
|
||||
|
||||
def SetFanSpeed(self, speed):
|
||||
NotImplemented
|
||||
Reference in New Issue
Block a user