mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add device info to Google (#118074)
This commit is contained in:
parent
da74ac06d7
commit
4b0f58ec63
@ -16,7 +16,7 @@ from homeassistant.config_entries import ConfigEntry
|
|||||||
from homeassistant.const import CONF_LLM_HASS_API, MATCH_ALL
|
from homeassistant.const import CONF_LLM_HASS_API, MATCH_ALL
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import HomeAssistantError, TemplateError
|
from homeassistant.exceptions import HomeAssistantError, TemplateError
|
||||||
from homeassistant.helpers import intent, llm, template
|
from homeassistant.helpers import device_registry as dr, intent, llm, template
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util import ulid
|
from homeassistant.util import ulid
|
||||||
|
|
||||||
@ -111,13 +111,20 @@ class GoogleGenerativeAIConversationEntity(
|
|||||||
"""Google Generative AI conversation agent."""
|
"""Google Generative AI conversation agent."""
|
||||||
|
|
||||||
_attr_has_entity_name = True
|
_attr_has_entity_name = True
|
||||||
|
_attr_name = None
|
||||||
|
|
||||||
def __init__(self, entry: ConfigEntry) -> None:
|
def __init__(self, entry: ConfigEntry) -> None:
|
||||||
"""Initialize the agent."""
|
"""Initialize the agent."""
|
||||||
self.entry = entry
|
self.entry = entry
|
||||||
self.history: dict[str, list[genai_types.ContentType]] = {}
|
self.history: dict[str, list[genai_types.ContentType]] = {}
|
||||||
self._attr_name = entry.title
|
|
||||||
self._attr_unique_id = entry.entry_id
|
self._attr_unique_id = entry.entry_id
|
||||||
|
self._attr_device_info = dr.DeviceInfo(
|
||||||
|
identifiers={(DOMAIN, entry.entry_id)},
|
||||||
|
name=entry.title,
|
||||||
|
manufacturer="Google",
|
||||||
|
model="Generative AI",
|
||||||
|
entry_type=dr.DeviceEntryType.SERVICE,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_languages(self) -> list[str] | Literal["*"]:
|
def supported_languages(self) -> list[str] | Literal["*"]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user