refactor: reorder smartctl command fallback chain to prioritize -d sat mode before standard commands

Move -d sat variants of -A and -x commands to front of fallback chain before non-sat equivalents in smart_temperature() function to improve compatibility with SATA drives behind USB/RAID controllers
This commit is contained in:
2026-08-16 20:09:53 +02:00
parent 9373e93e7f
commit f820a99c7c
+2 -2
View File
@@ -371,10 +371,10 @@ def smart_temperature(device):
return None return None
for command in ( for command in (
["smartctl", "-A", smart_device],
["smartctl", "-A", "-d", "sat", smart_device], ["smartctl", "-A", "-d", "sat", smart_device],
["smartctl", "-x", smart_device],
["smartctl", "-x", "-d", "sat", smart_device], ["smartctl", "-x", "-d", "sat", smart_device],
["smartctl", "-A", smart_device],
["smartctl", "-x", smart_device],
): ):
output, _ = _read_command(command, timeout=6, warn_on_nonzero=False) output, _ = _read_command(command, timeout=6, warn_on_nonzero=False)
temperature = extract(output) temperature = extract(output)