mirror of
https://github.com/home-assistant/core.git
synced 2025-11-16 14:30:22 +00:00
Filter out service type devices in extended analytics (#153271)
This commit is contained in:
@@ -1085,17 +1085,6 @@ async def test_devices_payload_no_entities(
|
||||
"sw_version": "test-sw-version",
|
||||
"via_device": None,
|
||||
},
|
||||
{
|
||||
"entities": [],
|
||||
"entry_type": "service",
|
||||
"has_configuration_url": False,
|
||||
"hw_version": None,
|
||||
"manufacturer": "test-manufacturer",
|
||||
"model": None,
|
||||
"model_id": "test-model-id",
|
||||
"sw_version": None,
|
||||
"via_device": None,
|
||||
},
|
||||
{
|
||||
"entities": [],
|
||||
"entry_type": None,
|
||||
@@ -1160,6 +1149,13 @@ async def test_devices_payload_with_entities(
|
||||
manufacturer="test-manufacturer",
|
||||
model_id="test-model-id",
|
||||
)
|
||||
device_entry_3 = device_registry.async_get_or_create(
|
||||
config_entry_id=mock_config_entry.entry_id,
|
||||
identifiers={("device", "3")},
|
||||
manufacturer="test-manufacturer",
|
||||
model_id="test-model-id",
|
||||
entry_type=dr.DeviceEntryType.SERVICE,
|
||||
)
|
||||
|
||||
# First device
|
||||
|
||||
@@ -1209,6 +1205,14 @@ async def test_devices_payload_with_entities(
|
||||
device_id=device_entry_2.id,
|
||||
)
|
||||
|
||||
# Third device (service type)
|
||||
entity_registry.async_get_or_create(
|
||||
domain="light",
|
||||
platform="hue",
|
||||
unique_id="4",
|
||||
device_id=device_entry_3.id,
|
||||
)
|
||||
|
||||
# Entity without device with unit of measurement and state class
|
||||
entity_registry.async_get_or_create(
|
||||
domain="sensor",
|
||||
|
||||
Reference in New Issue
Block a user