From c7309663de69e2e1bcccc329bb2ac16e59724c4b Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Tue, 10 Feb 2026 12:56:37 -0500 Subject: [PATCH] =?UTF-8?q?Fix=20NVMe=20temperature=20parsing=20bug=20for?= =?UTF-8?q?=20values=20>=2099=C2=B0C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace digits[:2] truncation with regex extraction of complete number. Previously "123°C" would be parsed as 12 instead of 123. Resolves https://code.lotusguild.org/LotusGuild/hwmonDaemon/issues/8 Co-Authored-By: Claude Opus 4.6 --- hwmonDaemon.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hwmonDaemon.py b/hwmonDaemon.py index c985e94..7a247e3 100644 --- a/hwmonDaemon.py +++ b/hwmonDaemon.py @@ -2574,10 +2574,10 @@ class SystemHealthMonitor: temp_str = line.split(':')[1].strip() if ':' in line else line.strip() logger.debug(f"Raw temperature string: {temp_str}") - # Extract first temperature value more safely - digits = ''.join(c for c in temp_str if c.isdigit()) - if len(digits) >= 2: - temp_value = int(digits[:2]) + # Extract the first complete number from temperature string + temp_match = re.search(r'(\d+)', temp_str) + if temp_match: + temp_value = int(temp_match.group(1)) logger.debug(f"Parsed temperature value: {temp_value}") # Set both temperature fields