mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Migrate Ollama to has entity name (#149303)
This commit is contained in:
parent
edf6166a9f
commit
dcf29d12a7
@ -170,11 +170,13 @@ async def _transform_stream(
|
|||||||
class OllamaBaseLLMEntity(Entity):
|
class OllamaBaseLLMEntity(Entity):
|
||||||
"""Ollama base LLM entity."""
|
"""Ollama base LLM entity."""
|
||||||
|
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
_attr_name = None
|
||||||
|
|
||||||
def __init__(self, entry: OllamaConfigEntry, subentry: ConfigSubentry) -> None:
|
def __init__(self, entry: OllamaConfigEntry, subentry: ConfigSubentry) -> None:
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
self.entry = entry
|
self.entry = entry
|
||||||
self.subentry = subentry
|
self.subentry = subentry
|
||||||
self._attr_name = subentry.title
|
|
||||||
self._attr_unique_id = subentry.subentry_id
|
self._attr_unique_id = subentry.subentry_id
|
||||||
|
|
||||||
model, _, version = subentry.data[CONF_MODEL].partition(":")
|
model, _, version = subentry.data[CONF_MODEL].partition(":")
|
||||||
|
@ -619,7 +619,6 @@ async def test_conversation_agent(
|
|||||||
assert entity_entry
|
assert entity_entry
|
||||||
subentry = mock_config_entry.subentries.get(entity_entry.unique_id)
|
subentry = mock_config_entry.subentries.get(entity_entry.unique_id)
|
||||||
assert subentry
|
assert subentry
|
||||||
assert entity_entry.original_name == subentry.title
|
|
||||||
|
|
||||||
device_entry = device_registry.async_get(entity_entry.device_id)
|
device_entry = device_registry.async_get(entity_entry.device_id)
|
||||||
assert device_entry
|
assert device_entry
|
||||||
|
Loading…
x
Reference in New Issue
Block a user