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
265265 return 0
266266
267267
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
268270class Disk (sensors .Disk ):
269271 @staticmethod
270272 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
277273 return psutil .disk_usage ("/" ).percent
278274
279275 @staticmethod
280276 def disk_used () -> int : # In bytes
281- # Get this data from psutil because it is not available from LibreHardwareMonitor
282277 return psutil .disk_usage ("/" ).used
283278
284279 @staticmethod
285280 def disk_free () -> int : # In bytes
286- # Get this data from psutil because it is not available from LibreHardwareMonitor
287281 return psutil .disk_usage ("/" ).free
288282
289283
You can’t perform that action at this time.
0 commit comments