fix(homeassistant): storage reads used of total with its percentage, and an OS update is said to wait on a reboot (#6753, #6754)
CI / lint (push) Successful in 2s
CI / unit (push) Successful in 1m36s
CI / integration (push) Successful in 1m59s
CI / publish (push) Successful in 19s

The tile shows Home Assistant's own used figure beside the total, so it matches
Home Assistant's storage page. An OS update doesn't reboot the machine: Supervisor
writes the image, reports the new version and raises a repair asking for a reboot.
The confirmation, schedule warning, MCP docs and plugin docs now say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-01 18:51:28 -05:00
co-authored by Claude Opus 5.5
parent 5ffececae5
commit 4c57735dd9
8 changed files with 41 additions and 20 deletions
+15 -4
View File
@@ -533,18 +533,29 @@ def test_a_poll_keeps_the_system_problems_and_records_them(app):
assert metrics["problems_open"] == 2.0 and metrics["disk_free_pct"] == 50.0 and metrics["update_failed"] == 0.0
def test_the_page_shows_the_devices_storage_and_how_full_it_is(app):
def test_the_page_shows_storage_used_of_the_total_with_the_percentage(app):
async def go():
await _clean(app, health={"repairs_read": True, "problems": [], "disk_free_gb": 99.8,
"disk_total_gb": 116.5, "disk_free_pct": 85.7})
await _clean(app, health={"repairs_read": True, "problems": [], "disk_free_gb": 99.8, "disk_used_gb": 12.0,
"disk_total_gb": 116.5, "disk_free_pct": 85.7, "disk_used_pct": 10.3})
web, _ = await _admin_client(app)
return await (await web.get("/plugins/homeassistant/")).get_data(as_text=True)
page = asyncio.run(go())
assert "116.5 GB" in page and "14% full" in page
assert "12.0 of 116.5 GB (10%)" in page
assert "Disk free" not in page
def test_the_page_says_an_os_update_waits_on_a_reboot_rather_than_making_one(app):
async def go():
await _clean(app)
web, _ = await _admin_client(app)
return await (await web.get("/plugins/homeassistant/")).get_data(as_text=True)
page = asyncio.run(go())
assert "takes effect only once you reboot the machine" in page
assert "reboots the machine" not in page
def test_a_report_it_couldnt_read_leaves_the_last_one_and_home_assistant_still_answers(app):
sched = _ha("scheduler")
ha = FakeHomeAssistant()
+5 -3
View File
@@ -111,9 +111,10 @@ def test_the_overview_names_what_needs_a_look_and_no_more():
def test_system_problems_are_read_from_what_home_assistant_answers():
healthy = s.read_health({"config": {"recovery_mode": False}, "issues": [], "resolution": {"unhealthy": [], "unsupported": []},
"host": {"disk_free": 99.8, "disk_total": 116.5}, "addons": [{"slug": "a", "state": "started"}]})
"host": {"disk_free": 99.8, "disk_used": 12.0, "disk_total": 116.5},
"addons": [{"slug": "a", "state": "started"}]})
assert healthy["problems"] == [] and healthy["repairs_read"] and healthy["supervised"]
assert healthy["disk_free_pct"] == 85.7
assert healthy["disk_free_pct"] == 85.7 and healthy["disk_used_gb"] == 12.0 and healthy["disk_used_pct"] == 10.3
bad = s.read_health({
"config": {"recovery_mode": True},
"issues": [{"domain": "hassio", "translation_key": "issue_system_reboot_required", "severity": "warning"},
@@ -133,7 +134,8 @@ def test_system_problems_are_read_from_what_home_assistant_answers():
def test_what_home_assistant_wouldnt_answer_is_not_read_as_fine():
found = s.read_health({"config": {}, "issues": None, "resolution": None, "host": None, "addons": None})
assert not found["repairs_read"] and not found["supervised"] and found["disk_free_pct"] is None
assert not found["repairs_read"] and not found["supervised"]
assert found["disk_free_pct"] is None and found["disk_used_pct"] is None
def test_a_schedule_installs_add_ons_then_core_then_the_os():