Skip to content

Commit

Permalink
Add GPU CLock sensor from LibreHardwareMonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
mathoudebine committed Mar 3, 2024
1 parent a9e7253 commit 181c954
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions library/sensors/sensors_librehardwaremonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ def fan_percent(cls) -> float:
try:
for sensor in gpu_to_use.Sensors:
if sensor.SensorType == Hardware.SensorType.Control:
return float(sensor.Value)
if sensor.Value:
return float(sensor.Value)
except:
pass

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

try:
for sensor in gpu_to_use.Sensors:
if sensor.SensorType == Hardware.SensorType.Control:
pass
if sensor.SensorType == Hardware.SensorType.Clock:
# Keep only real core clocks, ignore effective core clocks
if "Core" in str(sensor.Name) and "Effective" not in str(sensor.Name):
if sensor.Value:
return float(sensor.Value)
except:
pass

Expand Down

0 comments on commit 181c954

Please sign in to comment.