Skip to content

Commit 181c954

Browse files
committed
Add GPU CLock sensor from LibreHardwareMonitor
1 parent a9e7253 commit 181c954

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

library/sensors/sensors_librehardwaremonitor.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ def fan_percent(cls) -> float:
323323
try:
324324
for sensor in gpu_to_use.Sensors:
325325
if sensor.SensorType == Hardware.SensorType.Control:
326-
return float(sensor.Value)
326+
if sensor.Value:
327+
return float(sensor.Value)
327328
except:
328329
pass
329330

@@ -339,8 +340,11 @@ def frequency(cls) -> float:
339340

340341
try:
341342
for sensor in gpu_to_use.Sensors:
342-
if sensor.SensorType == Hardware.SensorType.Control:
343-
pass
343+
if sensor.SensorType == Hardware.SensorType.Clock:
344+
# Keep only real core clocks, ignore effective core clocks
345+
if "Core" in str(sensor.Name) and "Effective" not in str(sensor.Name):
346+
if sensor.Value:
347+
return float(sensor.Value)
344348
except:
345349
pass
346350

0 commit comments

Comments
 (0)