LiquidGUI [1.3.0.0]
- Lots of refactoring.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
from liquidctl import find_liquidctl_devices, cli # type: ignore
|
||||
from liquidctl_helper_interface import LiquidCTL_Helper_Interface
|
||||
|
||||
class LiquidCTL_Helper(LiquidCTL_Helper_Interface):
|
||||
device_name = None
|
||||
device_temp = 0
|
||||
device_fanSpeed = 0
|
||||
device_pumpSpeed = 0
|
||||
device_fwVers = None
|
||||
|
||||
devices = find_liquidctl_devices()
|
||||
try:
|
||||
for dev in devices:
|
||||
with dev.connect():
|
||||
#print(f'{dev.description}')
|
||||
device_name = dev.description
|
||||
device_fwVers = ''.join(map(str, dev.firmware_version))
|
||||
except:
|
||||
pass
|
||||
|
||||
def ForceInit(self):
|
||||
init_status = self.dev.initialize()
|
||||
if init_status:
|
||||
for key, value, unit in init_status:
|
||||
#print(f'- {key}: {value} {unit}')
|
||||
device_fwVers = value
|
||||
|
||||
def TestConnectionState(self):
|
||||
if self.device_name != None:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def Update(self):
|
||||
with self.dev.connect():
|
||||
status = self.dev.get_status()
|
||||
for key, value, unit in status:
|
||||
#print(f'- {key}: {value} {unit}')
|
||||
if key == "Liquid temperature":
|
||||
self.device_temp = value
|
||||
elif key == "Fan speed":
|
||||
self.device_fanSpeed = value
|
||||
elif key == "Pump speed":
|
||||
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)]})
|
||||
Reference in New Issue
Block a user