diff --git a/app.py b/app.py index a4e9e11..90203e6 100644 --- a/app.py +++ b/app.py @@ -358,9 +358,13 @@ def smart_temperature(device): return "Nicht verfügbar" smart_device = device.replace("/dev/", f"{HOST_DEVICE_PATH.rstrip('/')}/", 1) def extract(output): - for line in output.splitlines(): - if not re.search(r"temperature|airflow", line, re.IGNORECASE): - continue + lines = output.splitlines() + # Seagate and similar drives often expose both Airflow_Temperature + # and Temperature_Celsius. Prefer the latter because it is the + # physical drive temperature shown by the usual terminal command. + ordered = [line for line in lines if re.search(r"Temperature_Celsius|Drive_Temperature|Current Drive Temperature", line, re.IGNORECASE)] + ordered += [line for line in lines if line not in ordered and re.search(r"temperature|airflow", line, re.IGNORECASE)] + for line in ordered: explicit = re.search(r"(\d{1,3})\s*(?:°\s*C|Celsius|degrees?\s*C)\b", line, re.IGNORECASE) if explicit and 0 < int(explicit.group(1)) < 150: return f"{int(explicit.group(1))} °C"