From 98e435674cec4f5ac53a940713955f76bb2d6f1c Mon Sep 17 00:00:00 2001 From: adam Date: Sat, 7 Mar 2026 05:21:41 +0000 Subject: [PATCH] Fix smart_supported: treat null smart_support as unsupported --- services/smart.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/smart.py b/services/smart.py index c32d4e5..b0b700e 100644 --- a/services/smart.py +++ b/services/smart.py @@ -73,8 +73,8 @@ async def _run_smartctl(device: str) -> dict: def _parse_smart_json(device: str, data: dict) -> dict: """Extract relevant fields from smartctl JSON output.""" - smart_support = data.get("smart_support", {}) - is_supported = smart_support.get("available", True) if smart_support else True + smart_support = data.get("smart_support") + is_supported = smart_support.get("available", True) if isinstance(smart_support, dict) else False result: dict = {"device": device, "smart_supported": is_supported} # Identity — ATA vs SCSI field names