From 8b5bdf9e2fd352c570251a44817fdb3e673688d7 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 18 Jul 2023 12:09:22 +0200 Subject: [PATCH] Add entity translations to Whirlpool (#96823) --- homeassistant/components/whirlpool/climate.py | 1 + homeassistant/components/whirlpool/sensor.py | 8 +++----- homeassistant/components/whirlpool/strings.json | 5 +++++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/whirlpool/climate.py b/homeassistant/components/whirlpool/climate.py index 2b658387ef5..d1c5d6cf8f8 100644 --- a/homeassistant/components/whirlpool/climate.py +++ b/homeassistant/components/whirlpool/climate.py @@ -93,6 +93,7 @@ class AirConEntity(ClimateEntity): _attr_fan_modes = SUPPORTED_FAN_MODES _attr_has_entity_name = True + _attr_name = None _attr_hvac_modes = SUPPORTED_HVAC_MODES _attr_max_temp = SUPPORTED_MAX_TEMP _attr_min_temp = SUPPORTED_MIN_TEMP diff --git a/homeassistant/components/whirlpool/sensor.py b/homeassistant/components/whirlpool/sensor.py index de415035c76..37b16530b0d 100644 --- a/homeassistant/components/whirlpool/sensor.py +++ b/homeassistant/components/whirlpool/sensor.py @@ -105,7 +105,6 @@ class WhirlpoolSensorEntityDescription( SENSORS: tuple[WhirlpoolSensorEntityDescription, ...] = ( WhirlpoolSensorEntityDescription( key="state", - name="State", translation_key="whirlpool_machine", device_class=SensorDeviceClass.ENUM, options=( @@ -117,7 +116,6 @@ SENSORS: tuple[WhirlpoolSensorEntityDescription, ...] = ( ), WhirlpoolSensorEntityDescription( key="DispenseLevel", - name="Detergent Level", translation_key="whirlpool_tank", entity_registry_enabled_default=False, device_class=SensorDeviceClass.ENUM, @@ -131,7 +129,7 @@ SENSORS: tuple[WhirlpoolSensorEntityDescription, ...] = ( SENSOR_TIMER: tuple[SensorEntityDescription] = ( SensorEntityDescription( key="timeremaining", - name="End Time", + translation_key="end_time", device_class=SensorDeviceClass.TIMESTAMP, ), ) @@ -183,6 +181,7 @@ class WasherDryerClass(SensorEntity): """A class for the whirlpool/maytag washer account.""" _attr_should_poll = False + _attr_has_entity_name = True def __init__( self, @@ -205,7 +204,6 @@ class WasherDryerClass(SensorEntity): name=name.capitalize(), manufacturer="Whirlpool", ) - self._attr_has_entity_name = True self._attr_unique_id = f"{said}-{description.key}" async def async_added_to_hass(self) -> None: @@ -231,6 +229,7 @@ class WasherDryerTimeClass(RestoreSensor): """A timestamp class for the whirlpool/maytag washer account.""" _attr_should_poll = False + _attr_has_entity_name = True def __init__( self, @@ -254,7 +253,6 @@ class WasherDryerTimeClass(RestoreSensor): name=name.capitalize(), manufacturer="Whirlpool", ) - self._attr_has_entity_name = True self._attr_unique_id = f"{said}-{description.key}" async def async_added_to_hass(self) -> None: diff --git a/homeassistant/components/whirlpool/strings.json b/homeassistant/components/whirlpool/strings.json index 94dc9aa219f..a24e42304d0 100644 --- a/homeassistant/components/whirlpool/strings.json +++ b/homeassistant/components/whirlpool/strings.json @@ -21,6 +21,7 @@ "entity": { "sensor": { "whirlpool_machine": { + "name": "State", "state": { "standby": "[%key:common::state::standby%]", "setting": "Setting", @@ -51,6 +52,7 @@ } }, "whirlpool_tank": { + "name": "Detergent level", "state": { "unknown": "Unknown", "empty": "Empty", @@ -59,6 +61,9 @@ "100": "100%", "active": "[%key:common::state::active%]" } + }, + "end_time": { + "name": "End time" } } }