Files
LiquidGUI/vitals_helper.py
Dunestorm 89129fc6e5 LiquidGUI [1.3.0.0]
- Continued refactoring.
2025-02-10 20:13:22 +00:00

28 lines
877 B
Python

from interfaces.vitals_helper_interface import VitalsHelperInterface
from enum import Enum
import psutil
class VitalsHelperLinux(VitalsHelperInterface):
class HWSensor(Enum):
lin_cpu_amd = ("k10temp", "Tctl")
lin_gpu_amd = ("amdgpu", "edge")
lin_mobo_asus = ("asus_wmi_sensors", "Motherboard Temperature")
def get_temps(self, _hw_sensor: HWSensor):
temps = psutil.sensors_temperatures()
if _hw_sensor.value[0] in temps:
for entry in temps[_hw_sensor.value[0]]:
if entry.label == _hw_sensor.value[1]:
return round(entry.current, 2)
class VitalsHelperWindows(VitalsHelperInterface):
def __init__(self):
print(f"{self.__class__.__name__} is not Implemented")
class HWSensor(Enum):
pass
def get_temps(self, _hw_sensor: HWSensor):
return 0