mirror of
https://github.com/Electric-Special/ha-core.git
synced 2026-03-21 03:03:17 +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()
|
for domain, integration_info in integration_inputs.items()
|
||||||
if (integration := integrations.get(domain)) is not None
|
if (integration := integrations.get(domain)) is not None
|
||||||
and integration.is_built_in
|
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
|
# Call integrations that implement the analytics platform
|
||||||
|
|||||||
@@ -934,6 +934,7 @@ class MockModule:
|
|||||||
def mock_manifest(self):
|
def mock_manifest(self):
|
||||||
"""Generate a mock manifest to represent this module."""
|
"""Generate a mock manifest to represent this module."""
|
||||||
return {
|
return {
|
||||||
|
"integration_type": "hub",
|
||||||
**loader.manifest_from_legacy_module(self.DOMAIN, self),
|
**loader.manifest_from_legacy_module(self.DOMAIN, self),
|
||||||
**(self._partial_manifest or {}),
|
**(self._partial_manifest or {}),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1195,7 +1195,7 @@ async def test_devices_payload_with_entities(
|
|||||||
# Entity from a different integration
|
# Entity from a different integration
|
||||||
entity_registry.async_get_or_create(
|
entity_registry.async_get_or_create(
|
||||||
domain="light",
|
domain="light",
|
||||||
platform="roomba",
|
platform="shelly",
|
||||||
unique_id="1",
|
unique_id="1",
|
||||||
device_id=device_entry.id,
|
device_id=device_entry.id,
|
||||||
has_entity_name=True,
|
has_entity_name=True,
|
||||||
@@ -1296,7 +1296,7 @@ async def test_devices_payload_with_entities(
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"roomba": {
|
"shelly": {
|
||||||
"devices": [],
|
"devices": [],
|
||||||
"entities": [
|
"entities": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -197,6 +197,7 @@ async def test_download_diagnostics(
|
|||||||
"codeowners": ["test"],
|
"codeowners": ["test"],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"domain": "fake_integration",
|
"domain": "fake_integration",
|
||||||
|
"integration_type": "hub",
|
||||||
"is_built_in": True,
|
"is_built_in": True,
|
||||||
"overwrites_built_in": False,
|
"overwrites_built_in": False,
|
||||||
"name": "fake_integration",
|
"name": "fake_integration",
|
||||||
@@ -301,6 +302,7 @@ async def test_download_diagnostics(
|
|||||||
"codeowners": [],
|
"codeowners": [],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"domain": "fake_integration",
|
"domain": "fake_integration",
|
||||||
|
"integration_type": "hub",
|
||||||
"is_built_in": True,
|
"is_built_in": True,
|
||||||
"overwrites_built_in": False,
|
"overwrites_built_in": False,
|
||||||
"name": "fake_integration",
|
"name": "fake_integration",
|
||||||
|
|||||||
Reference in New Issue
Block a user