Add entity translations to Whirlpool (#96823)

This commit is contained in:
Joost Lekkerkerker 2023-07-18 12:09:22 +02:00 committed by GitHub
parent 1a9e27cdaf
commit 8b5bdf9e2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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:

View File

@ -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"
}
}
}