Filter out empty integration type in extended analytics (#153188)

This commit is contained in:
Artur Pragacz
2025-09-29 15:18:15 +02:00
committed by GitHub
parent f0c29c7699
commit 76cb4d123a
4 changed files with 6 additions and 3 deletions

View File

@@ -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

View File

@@ -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 {}),
}

View File

@@ -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": [
{

View File

@@ -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",