Add OS version and board type to analytics (#49725)

This commit is contained in:
Joakim Sørensen
2021-04-28 19:13:09 +02:00
committed by GitHub
parent 311e0e4185
commit 296dc9303f
3 changed files with 23 additions and 1 deletions
+11 -1
View File
@@ -133,6 +133,9 @@ async def test_send_base_with_supervisor(hass, caplog, aioclient_mock):
with patch(
"homeassistant.components.hassio.get_supervisor_info",
side_effect=Mock(return_value={"supported": True, "healthy": True}),
), patch(
"homeassistant.components.hassio.get_os_info",
side_effect=Mock(return_value={"board": "blue", "version": "123"}),
), patch(
"homeassistant.components.hassio.get_info",
side_effect=Mock(return_value={}),
@@ -154,7 +157,8 @@ async def test_send_base_with_supervisor(hass, caplog, aioclient_mock):
assert f"'uuid': '{MOCK_UUID}'" in caplog.text
assert f"'version': '{MOCK_VERSION}'" in caplog.text
assert "'supervisor': {'healthy': True, 'supported': True}}" in caplog.text
assert "'supervisor': {'healthy': True, 'supported': True}" in caplog.text
assert "'operating_system': {'board': 'blue', 'version': '123'}" in caplog.text
assert "'installation_type':" in caplog.text
assert "'integration_count':" not in caplog.text
assert "'integrations':" not in caplog.text
@@ -196,6 +200,9 @@ async def test_send_usage_with_supervisor(hass, caplog, aioclient_mock):
"addons": [{"slug": "test_addon"}],
}
),
), patch(
"homeassistant.components.hassio.get_os_info",
side_effect=Mock(return_value={}),
), patch(
"homeassistant.components.hassio.get_info",
side_effect=Mock(return_value={}),
@@ -299,6 +306,9 @@ async def test_send_statistics_with_supervisor(hass, caplog, aioclient_mock):
"addons": [{"slug": "test_addon"}],
}
),
), patch(
"homeassistant.components.hassio.get_os_info",
side_effect=Mock(return_value={}),
), patch(
"homeassistant.components.hassio.get_info",
side_effect=Mock(return_value={}),