Fix the spare/lifetime calculation, will need more robust logic later

This commit is contained in:
2025-11-21 10:48:12 +01:00
parent c6fd0ab50d
commit 49c8c4ef91

View File

@@ -95,9 +95,6 @@ def parse_smart_data(data, device_node, rotation):
if disk_type == "SSD":
is_life_attr = False
# ID 231: SSD_Life_Left (Normalized value is %)
if id_ == 231: is_life_attr = True
# ID 202: Percent_Lifetime_Remain
if id_ == 202: is_life_attr = True
@@ -107,6 +104,9 @@ def parse_smart_data(data, device_node, rotation):
# ID 233: Only if name is NOT "writes" (Avoids collision with Flash_Writes_GiB)
if id_ == 233 and 'write' not in name: is_life_attr = True
# ID 231: SSD_Life_Left (Normalized value is %)
if id_ == 231: is_life_attr = True
if is_life_attr and norm_val is not None:
spare = f"{norm_val}%"