Skip to content

Commit 76cb4d1

Browse files
authored
Filter out empty integration type in extended analytics (home-assistant#153188)
1 parent f0c29c7 commit 76cb4d1

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

homeassistant/components/analytics/analytics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ async def async_devices_payload(hass: HomeAssistant) -> dict:
551551
for domain, integration_info in integration_inputs.items()
552552
if (integration := integrations.get(domain)) is not None
553553
and integration.is_built_in
554-
and integration.integration_type in ("device", "hub")
554+
and integration.manifest.get("integration_type") in ("device", "hub")
555555
}
556556

557557
# Call integrations that implement the analytics platform

tests/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,7 @@ def __init__(
934934
def mock_manifest(self):
935935
"""Generate a mock manifest to represent this module."""
936936
return {
937+
"integration_type": "hub",
937938
**loader.manifest_from_legacy_module(self.DOMAIN, self),
938939
**(self._partial_manifest or {}),
939940
}

tests/components/analytics/test_analytics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ async def test_devices_payload_with_entities(
11951195
# Entity from a different integration
11961196
entity_registry.async_get_or_create(
11971197
domain="light",
1198-
platform="roomba",
1198+
platform="shelly",
11991199
unique_id="1",
12001200
device_id=device_entry.id,
12011201
has_entity_name=True,
@@ -1296,7 +1296,7 @@ async def test_devices_payload_with_entities(
12961296
},
12971297
],
12981298
},
1299-
"roomba": {
1299+
"shelly": {
13001300
"devices": [],
13011301
"entities": [
13021302
{

tests/components/diagnostics/test_init.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ async def test_download_diagnostics(
197197
"codeowners": ["test"],
198198
"dependencies": [],
199199
"domain": "fake_integration",
200+
"integration_type": "hub",
200201
"is_built_in": True,
201202
"overwrites_built_in": False,
202203
"name": "fake_integration",
@@ -301,6 +302,7 @@ async def test_download_diagnostics(
301302
"codeowners": [],
302303
"dependencies": [],
303304
"domain": "fake_integration",
305+
"integration_type": "hub",
304306
"is_built_in": True,
305307
"overwrites_built_in": False,
306308
"name": "fake_integration",

0 commit comments

Comments
 (0)