diff --git a/homeassistant/helpers/entity_registry.py b/homeassistant/helpers/entity_registry.py index 51afe4fc740..eb0aace4265 100644 --- a/homeassistant/helpers/entity_registry.py +++ b/homeassistant/helpers/entity_registry.py @@ -511,10 +511,6 @@ class EntityRegistryItems(UserDict[str, RegistryEntry]): self._unindex_entry(key) super().__delitem__(key) - def get_entity_ids(self) -> ValuesView[str]: - """Return entity ids.""" - return self._index.values() - def get_device_ids(self) -> KeysView[str]: """Return device ids.""" return self._device_id_index.keys() @@ -620,11 +616,6 @@ class EntityRegistry: """Check if an entity_id is currently registered.""" return self.entities.get_entity_id((domain, platform, unique_id)) - @callback - def async_entity_ids(self) -> list[str]: - """Return entity ids.""" - return list(self.entities.get_entity_ids()) - @callback def async_device_ids(self) -> list[str]: """Return known device ids.""" diff --git a/tests/helpers/test_entity_registry.py b/tests/helpers/test_entity_registry.py index 1b0fbe51147..271494b60a6 100644 --- a/tests/helpers/test_entity_registry.py +++ b/tests/helpers/test_entity_registry.py @@ -91,7 +91,6 @@ def test_get_or_create_updates_data(entity_registry: er.EntityRegistry) -> None: ) assert set(entity_registry.async_device_ids()) == {"mock-dev-id"} - assert set(entity_registry.async_entity_ids()) == {"light.hue_5678"} assert orig_entry == er.RegistryEntry( "light.hue_5678", @@ -163,7 +162,6 @@ def test_get_or_create_updates_data(entity_registry: er.EntityRegistry) -> None: ) assert set(entity_registry.async_device_ids()) == {"new-mock-dev-id"} - assert set(entity_registry.async_entity_ids()) == {"light.hue_5678"} new_entry = entity_registry.async_get_or_create( "light", @@ -210,7 +208,6 @@ def test_get_or_create_updates_data(entity_registry: er.EntityRegistry) -> None: ) assert set(entity_registry.async_device_ids()) == set() - assert set(entity_registry.async_entity_ids()) == {"light.hue_5678"} def test_get_or_create_suggested_object_id_conflict_register( @@ -455,8 +452,6 @@ def test_async_get_entity_id(entity_registry: er.EntityRegistry) -> None: ) assert entity_registry.async_get_entity_id("light", "hue", "123") is None - assert set(entity_registry.async_entity_ids()) == {"light.hue_1234"} - async def test_updating_config_entry_id( hass: HomeAssistant, entity_registry: er.EntityRegistry @@ -1480,7 +1475,6 @@ def test_entity_registry_items() -> None: entities = er.EntityRegistryItems() assert entities.get_entity_id(("a", "b", "c")) is None assert entities.get_entry("abc") is None - assert set(entities.get_entity_ids()) == set() entry1 = er.RegistryEntry("test.entity1", "1234", "hue") entry2 = er.RegistryEntry("test.entity2", "2345", "hue") @@ -1494,7 +1488,6 @@ def test_entity_registry_items() -> None: assert entities.get_entry(entry1.id) is entry1 assert entities.get_entity_id(("test", "hue", "2345")) is entry2.entity_id assert entities.get_entry(entry2.id) is entry2 - assert set(entities.get_entity_ids()) == {"test.entity2", "test.entity1"} entities.pop("test.entity1") del entities["test.entity2"] @@ -1504,8 +1497,6 @@ def test_entity_registry_items() -> None: assert entities.get_entity_id(("test", "hue", "2345")) is None assert entities.get_entry(entry2.id) is None - assert set(entities.get_entity_ids()) == set() - async def test_disabled_by_str_not_allowed( hass: HomeAssistant, entity_registry: er.EntityRegistry