32 lines
1.1 KiB
Python
32 lines
1.1 KiB
Python
from liquidctl import find_liquidctl_devices
|
|
|
|
class LiquidCTL_Init():
|
|
device_name = None
|
|
device_temp = 0
|
|
device_fanSpeed = 0
|
|
device_pumpSpeed = 0
|
|
device_fwVers = 0
|
|
|
|
devices = find_liquidctl_devices()
|
|
for dev in devices:
|
|
with dev.connect():
|
|
#print(f'{dev.description}')
|
|
device_name = dev.description
|
|
init_status = dev.initialize()
|
|
|
|
if init_status:
|
|
for key, value, unit in init_status:
|
|
#print(f'- {key}: {value} {unit}')
|
|
device_fwVers = value
|
|
|
|
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 |