mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-20 10:28:45 +00:00
Fix disk usage calculation (#6339)
This commit is contained in:
@@ -343,7 +343,7 @@ class APIHost(CoreSysAttributes):
|
|||||||
|
|
||||||
disk = self.sys_hardware.disk
|
disk = self.sys_hardware.disk
|
||||||
|
|
||||||
total, used, _ = await self.sys_run_in_executor(
|
total, _, free = await self.sys_run_in_executor(
|
||||||
disk.disk_usage, self.sys_config.path_supervisor
|
disk.disk_usage, self.sys_config.path_supervisor
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -365,12 +365,13 @@ class APIHost(CoreSysAttributes):
|
|||||||
"id": "root",
|
"id": "root",
|
||||||
"label": "Root",
|
"label": "Root",
|
||||||
"total_bytes": total,
|
"total_bytes": total,
|
||||||
"used_bytes": used,
|
"used_bytes": total - free,
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"id": "system",
|
"id": "system",
|
||||||
"label": "System",
|
"label": "System",
|
||||||
"used_bytes": used
|
"used_bytes": total
|
||||||
|
- free
|
||||||
- sum(path["used_bytes"] for path in known_paths),
|
- sum(path["used_bytes"] for path in known_paths),
|
||||||
},
|
},
|
||||||
*known_paths,
|
*known_paths,
|
||||||
|
|||||||
Reference in New Issue
Block a user