From 2bc5092e6825579ba099188d52ba308d76f9d548 Mon Sep 17 00:00:00 2001 From: aldo94vp Date: Thu, 18 Apr 2024 15:01:14 -0600 Subject: [PATCH] chore: calculate used storage in all partitions check for all available partitions and calculate storage among all them --- library/sensors/sensors_librehardwaremonitor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/sensors/sensors_librehardwaremonitor.py b/library/sensors/sensors_librehardwaremonitor.py index 29436e3d..b37ab629 100644 --- a/library/sensors/sensors_librehardwaremonitor.py +++ b/library/sensors/sensors_librehardwaremonitor.py @@ -424,7 +424,11 @@ def virtual_free() -> int: # In bytes class Disk(sensors.Disk): @staticmethod def disk_usage_percent() -> float: - return psutil.disk_usage("/").percent + disks = psutil.disk_partitions(all=True) + usage = 0 + for disk in disks: + usage = usage + psutil.disk_usage(disk.device).percent + return usage / len(disks) # return all used space among all disks @staticmethod def disk_used() -> int: # In bytes