Add entity translations to radiotherm (#96745)
parent
98e166f795
commit
34f1b2b71d
|
@ -105,11 +105,11 @@ class RadioThermostat(RadioThermostatEntity, ClimateEntity):
|
|||
_attr_hvac_modes = OPERATION_LIST
|
||||
_attr_temperature_unit = UnitOfTemperature.FAHRENHEIT
|
||||
_attr_precision = PRECISION_HALVES
|
||||
_attr_name = None
|
||||
|
||||
def __init__(self, coordinator: RadioThermUpdateCoordinator) -> None:
|
||||
"""Initialize the thermostat."""
|
||||
super().__init__(coordinator)
|
||||
self._attr_name = self.init_data.name
|
||||
self._attr_unique_id = self.init_data.mac
|
||||
self._attr_fan_modes = CT30_FAN_OPERATION_LIST
|
||||
self._attr_supported_features = (
|
||||
|
|
|
@ -14,6 +14,8 @@ from .data import RadioThermUpdate
|
|||
class RadioThermostatEntity(CoordinatorEntity[RadioThermUpdateCoordinator]):
|
||||
"""Base class for radiotherm entities."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(self, coordinator: RadioThermUpdateCoordinator) -> None:
|
||||
"""Initialize the entity."""
|
||||
super().__init__(coordinator)
|
||||
|
|
|
@ -27,5 +27,12 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"entity": {
|
||||
"switch": {
|
||||
"hold": {
|
||||
"name": "Hold"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,10 +28,11 @@ async def async_setup_entry(
|
|||
class RadioThermHoldSwitch(RadioThermostatEntity, SwitchEntity):
|
||||
"""Provides radiotherm hold switch support."""
|
||||
|
||||
_attr_translation_key = "hold"
|
||||
|
||||
def __init__(self, coordinator: RadioThermUpdateCoordinator) -> None:
|
||||
"""Initialize the hold mode switch."""
|
||||
super().__init__(coordinator)
|
||||
self._attr_name = f"{coordinator.init_data.name} Hold"
|
||||
self._attr_unique_id = f"{coordinator.init_data.mac}_hold"
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in New Issue