From f90effc29988cece1b3f6acebc99f3563e5f313a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Mon, 23 May 2022 18:22:49 +0200 Subject: [PATCH] Add agent version to Supervisor system health (#72360) Co-authored-by: Stefan Agner --- homeassistant/components/hassio/strings.json | 1 + homeassistant/components/hassio/system_health.py | 1 + tests/components/hassio/test_system_health.py | 2 ++ 3 files changed, 4 insertions(+) diff --git a/homeassistant/components/hassio/strings.json b/homeassistant/components/hassio/strings.json index 875a79a60d7..90142bd453f 100644 --- a/homeassistant/components/hassio/strings.json +++ b/homeassistant/components/hassio/strings.json @@ -1,6 +1,7 @@ { "system_health": { "info": { + "agent_version": "Agent Version", "board": "Board", "disk_total": "Disk Total", "disk_used": "Disk Used", diff --git a/homeassistant/components/hassio/system_health.py b/homeassistant/components/hassio/system_health.py index 5ce38b0e121..1039a0237a8 100644 --- a/homeassistant/components/hassio/system_health.py +++ b/homeassistant/components/hassio/system_health.py @@ -44,6 +44,7 @@ async def system_health_info(hass: HomeAssistant): "host_os": host_info.get("operating_system"), "update_channel": info.get("channel"), "supervisor_version": f"supervisor-{info.get('supervisor')}", + "agent_version": host_info.get("agent_version"), "docker_version": info.get("docker"), "disk_total": f"{host_info.get('disk_total')} GB", "disk_used": f"{host_info.get('disk_used')} GB", diff --git a/tests/components/hassio/test_system_health.py b/tests/components/hassio/test_system_health.py index dcf18f7bc13..344ac9d63be 100644 --- a/tests/components/hassio/test_system_health.py +++ b/tests/components/hassio/test_system_health.py @@ -35,6 +35,7 @@ async def test_hassio_system_health(hass, aioclient_mock): } hass.data["hassio_host_info"] = { "operating_system": "Home Assistant OS 5.9", + "agent_version": "1337", "disk_total": "32.0", "disk_used": "30.0", } @@ -52,6 +53,7 @@ async def test_hassio_system_health(hass, aioclient_mock): info[key] = await val assert info == { + "agent_version": "1337", "board": "odroid-n2", "disk_total": "32.0 GB", "disk_used": "30.0 GB",