From afefa1661521633d64dbc32d129adbf0d7a2c205 Mon Sep 17 00:00:00 2001 From: Artur Pragacz <49985303+arturpragacz@users.noreply.github.com> Date: Wed, 24 Sep 2025 12:29:33 +0200 Subject: [PATCH] Remove analytics platform in automation (#152875) --- .../components/automation/analytics.py | 24 ----------- tests/components/automation/test_analytics.py | 41 ------------------- 2 files changed, 65 deletions(-) delete mode 100644 homeassistant/components/automation/analytics.py delete mode 100644 tests/components/automation/test_analytics.py diff --git a/homeassistant/components/automation/analytics.py b/homeassistant/components/automation/analytics.py deleted file mode 100644 index 06c9a553d8a..00000000000 --- a/homeassistant/components/automation/analytics.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Analytics platform.""" - -from homeassistant.components.analytics import ( - AnalyticsInput, - AnalyticsModifications, - EntityAnalyticsModifications, -) -from homeassistant.core import HomeAssistant -from homeassistant.helpers import entity_registry as er - - -async def async_modify_analytics( - hass: HomeAssistant, analytics_input: AnalyticsInput -) -> AnalyticsModifications: - """Modify the analytics.""" - ent_reg = er.async_get(hass) - - entities: dict[str, EntityAnalyticsModifications] = {} - for entity_id in analytics_input.entity_ids: - entity_entry = ent_reg.entities[entity_id] - if entity_entry.capabilities is not None: - entities[entity_id] = EntityAnalyticsModifications(capabilities=None) - - return AnalyticsModifications(entities=entities) diff --git a/tests/components/automation/test_analytics.py b/tests/components/automation/test_analytics.py deleted file mode 100644 index 803103d0245..00000000000 --- a/tests/components/automation/test_analytics.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Tests for analytics platform.""" - -import pytest - -from homeassistant.components.analytics import async_devices_payload -from homeassistant.components.automation import DOMAIN -from homeassistant.core import HomeAssistant -from homeassistant.helpers import entity_registry as er -from homeassistant.setup import async_setup_component - - -@pytest.mark.asyncio -async def test_analytics( - hass: HomeAssistant, entity_registry: er.EntityRegistry -) -> None: - """Test the analytics platform.""" - await async_setup_component(hass, "analytics", {}) - - entity_registry.async_get_or_create( - domain="automation", - platform="automation", - unique_id="automation1", - suggested_object_id="automation1", - capabilities={"id": "automation1"}, - ) - - result = await async_devices_payload(hass) - assert result["integrations"][DOMAIN]["entities"] == [ - { - "assumed_state": None, - "capabilities": None, - "domain": "automation", - "entity_category": None, - "has_entity_name": False, - "modified_by_integration": [ - "capabilities", - ], - "original_device_class": None, - "unit_of_measurement": None, - }, - ]