Migrate Anthropic to has entity name (#149302)

This commit is contained in:
Joost Lekkerkerker 2025-07-23 12:58:28 +02:00 committed by GitHub
parent 3dffd74607
commit eb8ca53a03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -311,11 +311,13 @@ def _create_token_stats(
class AnthropicBaseLLMEntity(Entity):
"""Anthropic base LLM entity."""
_attr_has_entity_name = True
_attr_name = None
def __init__(self, entry: AnthropicConfigEntry, subentry: ConfigSubentry) -> None:
"""Initialize the entity."""
self.entry = entry
self.subentry = subentry
self._attr_name = subentry.title
self._attr_unique_id = subentry.subentry_id
self._attr_device_info = dr.DeviceInfo(
identifiers={(DOMAIN, subentry.subentry_id)},