File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -265,25 +265,19 @@ def virtual_free() -> int: # In bytes
265
265
return 0
266
266
267
267
268
+ # NOTE: all disk data are fetched from psutil Python library, because LHM does not have it.
269
+ # This is because LHM is a hardware-oriented library, whereas used/free/total space is for partitions, not disks
268
270
class Disk (sensors .Disk ):
269
271
@staticmethod
270
272
def disk_usage_percent () -> float :
271
- disk = get_hw_and_update (Hardware .HardwareType .Storage )
272
- for sensor in disk .Sensors :
273
- if sensor .SensorType == Hardware .SensorType .Load and str (sensor .Name ).startswith ("Used Space" ):
274
- return float (sensor .Value )
275
-
276
- # Get this data from psutil if it is not available from LibreHardwareMonitor
277
273
return psutil .disk_usage ("/" ).percent
278
274
279
275
@staticmethod
280
276
def disk_used () -> int : # In bytes
281
- # Get this data from psutil because it is not available from LibreHardwareMonitor
282
277
return psutil .disk_usage ("/" ).used
283
278
284
279
@staticmethod
285
280
def disk_free () -> int : # In bytes
286
- # Get this data from psutil because it is not available from LibreHardwareMonitor
287
281
return psutil .disk_usage ("/" ).free
288
282
289
283
You can’t perform that action at this time.
0 commit comments