1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-02-14 23:18:21 +00:00

Fix storage space calculations to account for reserved system space (#29540)

This commit is contained in:
Petar Petrov
2026-02-10 19:13:58 +01:00
committed by GitHub
parent 1267003b42
commit 3c4c3e39e5
2 changed files with 6 additions and 2 deletions

View File

@@ -87,7 +87,9 @@ class HaConfigSystemNavigation extends LitElement {
description = this._storageInfo
? this.hass.localize("ui.panel.config.storage.description", {
percent_used: `${Math.round(
(this._storageInfo.used / this._storageInfo.total) * 100
((this._storageInfo.total - this._storageInfo.free) /
this._storageInfo.total) *
100
)}${blankBeforePercent(this.hass.locale)}%`,
free_space: `${this._storageInfo.free} GB`,
})

View File

@@ -105,9 +105,11 @@ export class StorageBreakdownChart extends LitElement {
storageInfo: HostDisksUsage | null | undefined
) => {
let totalSpaceGB = hostInfo.disk_total;
let usedSpaceGB = hostInfo.disk_used;
let freeSpaceGB =
hostInfo.disk_free || hostInfo.disk_total - hostInfo.disk_used;
// hostInfo.disk_used doesn't include system reserved space,
// so we calculate used space based on total and free space
let usedSpaceGB = totalSpaceGB - freeSpaceGB;
if (storageInfo) {
const totalSpace =