1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-26 21:47:15 +00:00

Handle disks with non-existing SMART attributes (#6077)

Not all disks have all SMART attributes available, e.g. Sentry showed
devices with missing "wctemp". In practice, any SMART attribute could
be missing. Make sure we handle this gracefully.
This commit is contained in:
Stefan Agner
2025-08-07 09:40:03 +02:00
committed by GitHub
parent 5d851ad747
commit cad14bf46e
5 changed files with 92 additions and 31 deletions

View File

@@ -46,6 +46,11 @@ class NVMeController(DBusServiceMock):
"critical_temp_time": Variant("i", 0),
}
def set_missing_attributes(self, missing_keys: list[str]):
"""Remove specified attributes to simulate drives that don't provide them."""
for key in missing_keys:
self.smart_get_attributes_response.pop(key, None)
@dbus_property(access=PropertyAccess.READ)
def State(self) -> "s":
"""Get State."""