Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion homeassistant/helpers/system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ async def async_get_system_info(hass: HomeAssistant) -> dict[str, Any]:

# Determine installation type on current data
if info_object["docker"]:
if info_object["user"] == "root":
if os.path.isfile("/OFFICIAL_IMAGE"):
Comment thread
ludeeus marked this conversation as resolved.
Outdated
info_object["installation_type"] = "Home Assistant Container"
else:
info_object["installation_type"] = "Unsupported Third Party Container"

elif is_virtual_env():
info_object["installation_type"] = "Home Assistant Core"

Expand Down
4 changes: 2 additions & 2 deletions tests/helpers/test_system_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ async def test_container_installationtype(hass):
assert info["installation_type"] == "Home Assistant Container"

with patch("platform.system", return_value="Linux"), patch(
"os.path.isfile", return_value=True
"os.path.isfile", side_effect=lambda file: file == "/.dockerenv"
), patch("homeassistant.helpers.system_info.getuser", return_value="user"):
info = await hass.helpers.system_info.async_get_system_info()
assert info["installation_type"] == "Unknown"
assert info["installation_type"] == "Unsupported Third Party Container"


async def test_getuser_keyerror(hass):
Expand Down