mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Add entity translations to radiotherm (#96745)
This commit is contained in:
parent
98e166f795
commit
34f1b2b71d
@ -105,11 +105,11 @@ class RadioThermostat(RadioThermostatEntity, ClimateEntity):
|
|||||||
_attr_hvac_modes = OPERATION_LIST
|
_attr_hvac_modes = OPERATION_LIST
|
||||||
_attr_temperature_unit = UnitOfTemperature.FAHRENHEIT
|
_attr_temperature_unit = UnitOfTemperature.FAHRENHEIT
|
||||||
_attr_precision = PRECISION_HALVES
|
_attr_precision = PRECISION_HALVES
|
||||||
|
_attr_name = None
|
||||||
|
|
||||||
def __init__(self, coordinator: RadioThermUpdateCoordinator) -> None:
|
def __init__(self, coordinator: RadioThermUpdateCoordinator) -> None:
|
||||||
"""Initialize the thermostat."""
|
"""Initialize the thermostat."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self._attr_name = self.init_data.name
|
|
||||||
self._attr_unique_id = self.init_data.mac
|
self._attr_unique_id = self.init_data.mac
|
||||||
self._attr_fan_modes = CT30_FAN_OPERATION_LIST
|
self._attr_fan_modes = CT30_FAN_OPERATION_LIST
|
||||||
self._attr_supported_features = (
|
self._attr_supported_features = (
|
||||||
|
@ -14,6 +14,8 @@ from .data import RadioThermUpdate
|
|||||||
class RadioThermostatEntity(CoordinatorEntity[RadioThermUpdateCoordinator]):
|
class RadioThermostatEntity(CoordinatorEntity[RadioThermUpdateCoordinator]):
|
||||||
"""Base class for radiotherm entities."""
|
"""Base class for radiotherm entities."""
|
||||||
|
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(self, coordinator: RadioThermUpdateCoordinator) -> None:
|
def __init__(self, coordinator: RadioThermUpdateCoordinator) -> None:
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
super().__init__(coordinator)
|
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):
|
class RadioThermHoldSwitch(RadioThermostatEntity, SwitchEntity):
|
||||||
"""Provides radiotherm hold switch support."""
|
"""Provides radiotherm hold switch support."""
|
||||||
|
|
||||||
|
_attr_translation_key = "hold"
|
||||||
|
|
||||||
def __init__(self, coordinator: RadioThermUpdateCoordinator) -> None:
|
def __init__(self, coordinator: RadioThermUpdateCoordinator) -> None:
|
||||||
"""Initialize the hold mode switch."""
|
"""Initialize the hold mode switch."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self._attr_name = f"{coordinator.init_data.name} Hold"
|
|
||||||
self._attr_unique_id = f"{coordinator.init_data.mac}_hold"
|
self._attr_unique_id = f"{coordinator.init_data.mac}_hold"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user