From e9683375e75397b5e39703e32ef18d8d5ce53894 Mon Sep 17 00:00:00 2001 From: emelarnz <4415320+emelarnz@users.noreply.github.com> Date: Mon, 31 Mar 2025 20:53:26 +1300 Subject: [PATCH] Restore use of config.cpu_thermal_zone (#208) Thanks, I have forgotten this one! --- src/rpi-cpu2mqtt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rpi-cpu2mqtt.py b/src/rpi-cpu2mqtt.py index ae6b849..19342f6 100644 --- a/src/rpi-cpu2mqtt.py +++ b/src/rpi-cpu2mqtt.py @@ -186,7 +186,9 @@ def check_cpu_temp(): if not temps: raise ValueError("No temperature sensors found.") - if "cpu_thermal" in temps: + if config.cpu_thermal_zone in temps: + cpu_temp = temps[config.cpu_thermal_zone][0].current + elif "cpu_thermal" in temps: cpu_temp = temps["cpu_thermal"][0].current elif "coretemp" in temps: cpu_temp = temps["coretemp"][0].current