Migrate Ollama to has entity name (#149303)

This commit is contained in:
Joost Lekkerkerker 2025-07-23 14:27:32 +02:00 committed by GitHub
parent edf6166a9f
commit dcf29d12a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -170,11 +170,13 @@ async def _transform_stream(
class OllamaBaseLLMEntity(Entity):
"""Ollama base LLM entity."""
_attr_has_entity_name = True
_attr_name = None
def __init__(self, entry: OllamaConfigEntry, subentry: ConfigSubentry) -> None:
"""Initialize the entity."""
self.entry = entry
self.subentry = subentry
self._attr_name = subentry.title
self._attr_unique_id = subentry.subentry_id
model, _, version = subentry.data[CONF_MODEL].partition(":")

View File

@ -619,7 +619,6 @@ async def test_conversation_agent(
assert entity_entry
subentry = mock_config_entry.subentries.get(entity_entry.unique_id)
assert subentry
assert entity_entry.original_name == subentry.title
device_entry = device_registry.async_get(entity_entry.device_id)
assert device_entry