cpu_thermal_zone is configurable now (#151)

This commit is contained in:
Masoko
2024-10-26 16:28:21 +03:00
committed by GitHub
parent 3103d2da47
commit c1fdc09b87
2 changed files with 5 additions and 2 deletions

View File

@@ -77,4 +77,7 @@ rpi5_fan_speed = False
rpi_power_status = False
# Check for apt updates - experimental feature, disabled by default, updateed with update_check_interval
apt_updates = False
apt_updates = False
# Change the thermal zone if you have issues with cpu temps
cpu_thermal_zone = 'cpu'

View File

@@ -108,7 +108,7 @@ def check_rpi_power_status():
def check_cpu_temp():
full_cmd = "awk '{printf (\"%.2f\\n\", $1/1000); }' $(for zone in /sys/class/thermal/thermal_zone*/; do grep -iq \"cpu\" \"${zone}type\" && echo \"${zone}temp\"; done)"
full_cmd = f"awk '{{printf (\"%.2f\\n\", $1/1000); }}' $(for zone in /sys/class/thermal/thermal_zone*/; do grep -iq \"{config.cpu_thermal_zone}\" \"${{zone}}type\" && echo \"${{zone}}temp\"; done)"
try:
p = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
cpu_temp = p.decode("utf-8").strip().replace(",", ".")