diff --git a/homeassistant/components/analytics/analytics.py b/homeassistant/components/analytics/analytics.py index 5795be4e027..2b67592e2f9 100644 --- a/homeassistant/components/analytics/analytics.py +++ b/homeassistant/components/analytics/analytics.py @@ -551,7 +551,7 @@ async def async_devices_payload(hass: HomeAssistant) -> dict: for domain, integration_info in integration_inputs.items() if (integration := integrations.get(domain)) is not None and integration.is_built_in - and integration.integration_type in ("device", "hub") + and integration.manifest.get("integration_type") in ("device", "hub") } # Call integrations that implement the analytics platform diff --git a/tests/common.py b/tests/common.py index e43e4bf5fee..419ba0ad466 100644 --- a/tests/common.py +++ b/tests/common.py @@ -934,6 +934,7 @@ class MockModule: def mock_manifest(self): """Generate a mock manifest to represent this module.""" return { + "integration_type": "hub", **loader.manifest_from_legacy_module(self.DOMAIN, self), **(self._partial_manifest or {}), } diff --git a/tests/components/analytics/test_analytics.py b/tests/components/analytics/test_analytics.py index 876e34dae75..be8f38901ee 100644 --- a/tests/components/analytics/test_analytics.py +++ b/tests/components/analytics/test_analytics.py @@ -1195,7 +1195,7 @@ async def test_devices_payload_with_entities( # Entity from a different integration entity_registry.async_get_or_create( domain="light", - platform="roomba", + platform="shelly", unique_id="1", device_id=device_entry.id, has_entity_name=True, @@ -1296,7 +1296,7 @@ async def test_devices_payload_with_entities( }, ], }, - "roomba": { + "shelly": { "devices": [], "entities": [ { diff --git a/tests/components/diagnostics/test_init.py b/tests/components/diagnostics/test_init.py index fe62efeebac..e27331811e6 100644 --- a/tests/components/diagnostics/test_init.py +++ b/tests/components/diagnostics/test_init.py @@ -197,6 +197,7 @@ async def test_download_diagnostics( "codeowners": ["test"], "dependencies": [], "domain": "fake_integration", + "integration_type": "hub", "is_built_in": True, "overwrites_built_in": False, "name": "fake_integration", @@ -301,6 +302,7 @@ async def test_download_diagnostics( "codeowners": [], "dependencies": [], "domain": "fake_integration", + "integration_type": "hub", "is_built_in": True, "overwrites_built_in": False, "name": "fake_integration",