From 72621d9d0ee79ad1889fc86636add9bd2de84ab9 Mon Sep 17 00:00:00 2001 From: SMKRV Date: Fri, 22 Nov 2024 16:58:22 +0300 Subject: [PATCH] Release v2.0.0 --- custom_components/ha_text_ai/sensor.py | 8 ++++---- custom_components/ha_text_ai/translations/en.json | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/custom_components/ha_text_ai/sensor.py b/custom_components/ha_text_ai/sensor.py index 1495ed7..effa466 100644 --- a/custom_components/ha_text_ai/sensor.py +++ b/custom_components/ha_text_ai/sensor.py @@ -62,6 +62,9 @@ async def async_setup_entry( class HATextAISensor(CoordinatorEntity, SensorEntity): """HA text AI Sensor.""" + _attr_has_entity_name = True + _attr_translation_key = "ha_text_ai" + def __init__( self, coordinator: HATextAICoordinator, @@ -71,10 +74,7 @@ class HATextAISensor(CoordinatorEntity, SensorEntity): super().__init__(coordinator) self._config_entry = config_entry self._attr_unique_id = config_entry.entry_id - self._attr_suggested_display_precision = 0 - self._error_count = 0 - self._last_error = None - self._state = STATE_INITIALIZING + self._attr_device_info = { "identifiers": {(DOMAIN, self._attr_unique_id)}, "name": "HA Text AI", diff --git a/custom_components/ha_text_ai/translations/en.json b/custom_components/ha_text_ai/translations/en.json index 0c02b8f..c3ad8ed 100644 --- a/custom_components/ha_text_ai/translations/en.json +++ b/custom_components/ha_text_ai/translations/en.json @@ -66,5 +66,12 @@ } } } + }, + "entity": { + "sensor": { + "ha_text_ai": { + "name": "HA Text AI" + } + } } }