From 103375ef9517b88743fa07d6002e134005a1a5cd Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Wed, 28 Jun 2023 13:57:04 +0200 Subject: [PATCH] Add entity translations to HVV Departures (#95442) * Add entity translations to HVV Departures * Add entity translations to HVV Departures --- homeassistant/components/hvv_departures/sensor.py | 8 ++++---- homeassistant/components/hvv_departures/strings.json | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/hvv_departures/sensor.py b/homeassistant/components/hvv_departures/sensor.py index 0669289c1bb..7cfd392808b 100644 --- a/homeassistant/components/hvv_departures/sensor.py +++ b/homeassistant/components/hvv_departures/sensor.py @@ -58,15 +58,15 @@ class HVVDepartureSensor(SensorEntity): _attr_attribution = ATTRIBUTION _attr_device_class = SensorDeviceClass.TIMESTAMP _attr_icon = ICON + _attr_translation_key = "departures" + _attr_has_entity_name = True + _attr_extra_state_attributes = {} + _attr_available = False def __init__(self, hass, config_entry, session, hub): """Initialize.""" self.config_entry = config_entry self.station_name = self.config_entry.data[CONF_STATION]["name"] - self._attr_extra_state_attributes = {} - self._attr_available = False - self._attr_has_entity_name = True - self._attr_name = "Departures" self._last_error = None self.gti = hub.gti diff --git a/homeassistant/components/hvv_departures/strings.json b/homeassistant/components/hvv_departures/strings.json index 90b53bc0e64..8f9c06f53fb 100644 --- a/homeassistant/components/hvv_departures/strings.json +++ b/homeassistant/components/hvv_departures/strings.json @@ -43,5 +43,12 @@ } } } + }, + "entity": { + "sensor": { + "departures": { + "name": "Departures" + } + } } }