From 8f87403d484d5b74d5d865c24cb3bc6fc3e395a5 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sun, 9 Mar 2025 22:00:23 -0400 Subject: [PATCH] idk --- hwmonDaemon.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hwmonDaemon.py b/hwmonDaemon.py index f60d0b7..e487e66 100644 --- a/hwmonDaemon.py +++ b/hwmonDaemon.py @@ -785,20 +785,19 @@ class SystemHealthMonitor: size_str = size_str.strip().upper() - match = re.match(r'^([\d.]+)\s*([KMGT])?B?$', size_str) # Corrected regex + match = re.match(r'^([\d.]+)\s*([KMGT])B?$', size_str) if match: value = float(match.group(1)) - unit = match.group(2) if match.group(2) else 'B' + unit = match.group(2) multipliers = { - 'B': 1, 'K': 1024, 'M': 1024**2, 'G': 1024**3, 'T': 1024**4 } - return value * multipliers[unit] + return value * multipliers.get(unit, 1) # Default to 1 for bytes return 0.0