mirror of
https://github.com/Electric-Special/ha-core.git
synced 2026-03-21 02:03:27 +01:00
Filter out empty integration type in extended analytics (#153188)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {}),
|
||||
}
|
||||
|
||||
@@ -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": [
|
||||
{
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user