mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-07-29 16:44:49 +02:00
Fix CPU temp sensors
This commit is contained in:
parent
beafca250f
commit
6be1547243
@ -10,4 +10,6 @@ GITHUB = "https://github.com/AdnanHodzic/auto-cpufreq"
|
|||||||
IS_INSTALLED_WITH_AUR = path.isfile("/etc/arch-release") and bool(getoutput("pacman -Qs auto-cpufreq"))
|
IS_INSTALLED_WITH_AUR = path.isfile("/etc/arch-release") and bool(getoutput("pacman -Qs auto-cpufreq"))
|
||||||
IS_INSTALLED_WITH_SNAP = getenv("PKG_MARKER") == "SNAP"
|
IS_INSTALLED_WITH_SNAP = getenv("PKG_MARKER") == "SNAP"
|
||||||
POWER_SUPPLY_DIR = "/sys/class/power_supply/"
|
POWER_SUPPLY_DIR = "/sys/class/power_supply/"
|
||||||
SNAP_DAEMON_CHECK = getoutput("snapctl get daemon")
|
SNAP_DAEMON_CHECK = getoutput("snapctl get daemon")
|
||||||
|
|
||||||
|
CPU_TEMP_SENSOR_PRIORITY = ("coretemp", "acpitz", "k10temp", "zenpower")
|
@ -11,6 +11,7 @@ from auto_cpufreq.config.config import config
|
|||||||
from auto_cpufreq.core import get_power_supply_ignore_list
|
from auto_cpufreq.core import get_power_supply_ignore_list
|
||||||
from auto_cpufreq.globals import (
|
from auto_cpufreq.globals import (
|
||||||
AVAILABLE_GOVERNORS_SORTED,
|
AVAILABLE_GOVERNORS_SORTED,
|
||||||
|
CPU_TEMP_SENSOR_PRIORITY,
|
||||||
IS_INSTALLED_WITH_SNAP,
|
IS_INSTALLED_WITH_SNAP,
|
||||||
POWER_SUPPLY_DIR,
|
POWER_SUPPLY_DIR,
|
||||||
)
|
)
|
||||||
@ -104,7 +105,13 @@ class SystemInfo:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
temps = psutil.sensors_temperatures()
|
temps = psutil.sensors_temperatures()
|
||||||
core_temps = [temp.current for temp in temps.get("coretemp", [])]
|
temp_sensor = []
|
||||||
|
for sensor in CPU_TEMP_SENSOR_PRIORITY:
|
||||||
|
temp_sensor = temps.get(sensor, [])
|
||||||
|
if temp_sensor != []:
|
||||||
|
break
|
||||||
|
|
||||||
|
core_temps = [temp.current for temp in temp_sensor]
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
core_temps = []
|
core_temps = []
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user