mirror of
https://github.com/smkrv/ha-text-ai.git
synced 2026-07-29 17:23:57 +08:00
Release v2.0.0
This commit is contained in:
@@ -96,13 +96,15 @@ class HATextAISensor(CoordinatorEntity, SensorEntity):
|
|||||||
self._conversation_history = []
|
self._conversation_history = []
|
||||||
self._system_prompt = None
|
self._system_prompt = None
|
||||||
|
|
||||||
|
sensor_name = f"HA Text AI {self._instance_name}"
|
||||||
|
|
||||||
# Entity attributes
|
# Entity attributes
|
||||||
self._attr_has_entity_name = True
|
self._attr_has_entity_name = True
|
||||||
self.entity_id = f"sensor.ha_text_ai_{slugify(self._instance_name)}"
|
self.entity_id = f"sensor.ha_text_ai_{slugify(self._instance_name)}"
|
||||||
self._attr_name = f"HA Text AI {self._instance_name}"
|
self._attr_name = sensor_name
|
||||||
self._attr_unique_id = f"{config_entry.entry_id}"
|
self._attr_unique_id = f"{config_entry.entry_id}"
|
||||||
|
|
||||||
# Entity description
|
# Entity description без дублирования
|
||||||
self.entity_description = SensorEntityDescription(
|
self.entity_description = SensorEntityDescription(
|
||||||
key=f"ha_text_ai_{self._instance_name}",
|
key=f"ha_text_ai_{self._instance_name}",
|
||||||
entity_registry_enabled_default=True,
|
entity_registry_enabled_default=True,
|
||||||
@@ -123,7 +125,7 @@ class HATextAISensor(CoordinatorEntity, SensorEntity):
|
|||||||
|
|
||||||
self._attr_device_info = DeviceInfo(
|
self._attr_device_info = DeviceInfo(
|
||||||
identifiers={(DOMAIN, self._attr_unique_id)},
|
identifiers={(DOMAIN, self._attr_unique_id)},
|
||||||
name=self._attr_name,
|
name=sensor_name,
|
||||||
manufacturer="Community",
|
manufacturer="Community",
|
||||||
model=f"{model} ({api_provider} provider)",
|
model=f"{model} ({api_provider} provider)",
|
||||||
sw_version="1.0.0",
|
sw_version="1.0.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user