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:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user