nvme temp fix?

This commit is contained in:
2025-03-03 20:18:06 -05:00
parent 04c1dc59ce
commit 862e125cc6

View File

@ -840,8 +840,11 @@ class SystemHealthMonitor:
) )
for line in nvme_result.stdout.split('\n'): for line in nvme_result.stdout.split('\n'):
if 'temperature' in line.lower(): if 'temperature' in line.lower():
smart_health['temp'] = int(line.split(':')[1].strip().split()[0]) temp_str = line.split(':')[1].strip()
break # Extract numeric temperature value
temp_value = int(''.join(filter(str.isdigit, temp_str)))
smart_health['temp'] = temp_value
break
except Exception as e: except Exception as e:
smart_health['status'] = 'ERROR' smart_health['status'] = 'ERROR'