Skip to content

Commit

Permalink
fix cpu temperature rpi4
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Oct 31, 2023
1 parent 186fa58 commit 8aac7c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ovos_PHAL_sensors/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ class CPUTemperatureSensor(NumericSensor):

@property
def value(self):
return psutil.sensors_temperatures()['coretemp'][0].current
temps = psutil.sensors_temperatures()
if "coretemp" in temps: # x86
return temps['coretemp'][0].current
if "cpu_thermal" in temps: # rpi
return temps['cpu_thermal'][0].current
return 0

@property
def attrs(self):
Expand Down

0 comments on commit 8aac7c6

Please sign in to comment.