mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Add translations for Netatmo thermostat preset modes (#128890)
This commit is contained in:
parent
110751e992
commit
28a8ed62f3
@ -58,9 +58,9 @@ from .entity import NetatmoRoomEntity
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
PRESET_FROST_GUARD = "Frost Guard"
|
||||
PRESET_SCHEDULE = "Schedule"
|
||||
PRESET_MANUAL = "Manual"
|
||||
PRESET_FROST_GUARD = "frost_guard"
|
||||
PRESET_SCHEDULE = "schedule"
|
||||
PRESET_MANUAL = "manual"
|
||||
|
||||
SUPPORT_FLAGS = (
|
||||
ClimateEntityFeature.TARGET_TEMPERATURE
|
||||
@ -188,6 +188,7 @@ class NetatmoThermostat(NetatmoRoomEntity, ClimateEntity):
|
||||
_attr_supported_features = SUPPORT_FLAGS
|
||||
_attr_target_temperature_step = PRECISION_HALVES
|
||||
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_translation_key = "thermostat"
|
||||
_attr_name = None
|
||||
_away: bool | None = None
|
||||
_connected: bool | None = None
|
||||
|
@ -1,5 +1,18 @@
|
||||
{
|
||||
"entity": {
|
||||
"climate": {
|
||||
"thermostat": {
|
||||
"state_attributes": {
|
||||
"preset_mode": {
|
||||
"state": {
|
||||
"frost_guard": "mdi:snowflake-thermometer",
|
||||
"schedule": "mdi:clock-outline",
|
||||
"manual": "mdi:gesture-tap"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"temp_trend": {
|
||||
"default": "mdi:trending-up"
|
||||
|
@ -168,6 +168,19 @@
|
||||
}
|
||||
},
|
||||
"entity": {
|
||||
"climate": {
|
||||
"thermostat": {
|
||||
"state_attributes": {
|
||||
"preset_mode": {
|
||||
"state": {
|
||||
"frost_guard": "Frost guard",
|
||||
"schedule": "Schedule",
|
||||
"manual": "Manual"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"temp_trend": {
|
||||
"name": "Temperature trend"
|
||||
|
@ -14,8 +14,8 @@
|
||||
'preset_modes': list([
|
||||
'away',
|
||||
'boost',
|
||||
'Frost Guard',
|
||||
'Schedule',
|
||||
'frost_guard',
|
||||
'schedule',
|
||||
]),
|
||||
'target_temp_step': 0.5,
|
||||
}),
|
||||
@ -41,7 +41,7 @@
|
||||
'platform': 'netatmo',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': <ClimateEntityFeature: 401>,
|
||||
'translation_key': None,
|
||||
'translation_key': 'thermostat',
|
||||
'unique_id': '222452125-DeviceType.OTM',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -60,8 +60,8 @@
|
||||
'preset_modes': list([
|
||||
'away',
|
||||
'boost',
|
||||
'Frost Guard',
|
||||
'Schedule',
|
||||
'frost_guard',
|
||||
'schedule',
|
||||
]),
|
||||
'supported_features': <ClimateEntityFeature: 401>,
|
||||
'target_temp_step': 0.5,
|
||||
@ -89,8 +89,8 @@
|
||||
'preset_modes': list([
|
||||
'away',
|
||||
'boost',
|
||||
'Frost Guard',
|
||||
'Schedule',
|
||||
'frost_guard',
|
||||
'schedule',
|
||||
]),
|
||||
'target_temp_step': 0.5,
|
||||
}),
|
||||
@ -116,7 +116,7 @@
|
||||
'platform': 'netatmo',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': <ClimateEntityFeature: 401>,
|
||||
'translation_key': None,
|
||||
'translation_key': 'thermostat',
|
||||
'unique_id': '2940411577-DeviceType.NRV',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -135,12 +135,12 @@
|
||||
]),
|
||||
'max_temp': 30,
|
||||
'min_temp': 7,
|
||||
'preset_mode': 'Frost Guard',
|
||||
'preset_mode': 'frost_guard',
|
||||
'preset_modes': list([
|
||||
'away',
|
||||
'boost',
|
||||
'Frost Guard',
|
||||
'Schedule',
|
||||
'frost_guard',
|
||||
'schedule',
|
||||
]),
|
||||
'selected_schedule': 'Default',
|
||||
'supported_features': <ClimateEntityFeature: 401>,
|
||||
@ -170,8 +170,8 @@
|
||||
'preset_modes': list([
|
||||
'away',
|
||||
'boost',
|
||||
'Frost Guard',
|
||||
'Schedule',
|
||||
'frost_guard',
|
||||
'schedule',
|
||||
]),
|
||||
'target_temp_step': 0.5,
|
||||
}),
|
||||
@ -197,7 +197,7 @@
|
||||
'platform': 'netatmo',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': <ClimateEntityFeature: 401>,
|
||||
'translation_key': None,
|
||||
'translation_key': 'thermostat',
|
||||
'unique_id': '1002003001-DeviceType.BNS',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -215,12 +215,12 @@
|
||||
]),
|
||||
'max_temp': 30,
|
||||
'min_temp': 7,
|
||||
'preset_mode': 'Schedule',
|
||||
'preset_mode': 'schedule',
|
||||
'preset_modes': list([
|
||||
'away',
|
||||
'boost',
|
||||
'Frost Guard',
|
||||
'Schedule',
|
||||
'frost_guard',
|
||||
'schedule',
|
||||
]),
|
||||
'selected_schedule': 'Default',
|
||||
'supported_features': <ClimateEntityFeature: 401>,
|
||||
@ -250,8 +250,8 @@
|
||||
'preset_modes': list([
|
||||
'away',
|
||||
'boost',
|
||||
'Frost Guard',
|
||||
'Schedule',
|
||||
'frost_guard',
|
||||
'schedule',
|
||||
]),
|
||||
'target_temp_step': 0.5,
|
||||
}),
|
||||
@ -277,7 +277,7 @@
|
||||
'platform': 'netatmo',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': <ClimateEntityFeature: 401>,
|
||||
'translation_key': None,
|
||||
'translation_key': 'thermostat',
|
||||
'unique_id': '2833524037-DeviceType.NRV',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -296,12 +296,12 @@
|
||||
]),
|
||||
'max_temp': 30,
|
||||
'min_temp': 7,
|
||||
'preset_mode': 'Frost Guard',
|
||||
'preset_mode': 'frost_guard',
|
||||
'preset_modes': list([
|
||||
'away',
|
||||
'boost',
|
||||
'Frost Guard',
|
||||
'Schedule',
|
||||
'frost_guard',
|
||||
'schedule',
|
||||
]),
|
||||
'selected_schedule': 'Default',
|
||||
'supported_features': <ClimateEntityFeature: 401>,
|
||||
@ -332,8 +332,8 @@
|
||||
'preset_modes': list([
|
||||
'away',
|
||||
'boost',
|
||||
'Frost Guard',
|
||||
'Schedule',
|
||||
'frost_guard',
|
||||
'schedule',
|
||||
]),
|
||||
'target_temp_step': 0.5,
|
||||
}),
|
||||
@ -359,7 +359,7 @@
|
||||
'platform': 'netatmo',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': <ClimateEntityFeature: 401>,
|
||||
'translation_key': None,
|
||||
'translation_key': 'thermostat',
|
||||
'unique_id': '2746182631-DeviceType.NATherm1',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
@ -382,8 +382,8 @@
|
||||
'preset_modes': list([
|
||||
'away',
|
||||
'boost',
|
||||
'Frost Guard',
|
||||
'Schedule',
|
||||
'frost_guard',
|
||||
'schedule',
|
||||
]),
|
||||
'selected_schedule': 'Default',
|
||||
'supported_features': <ClimateEntityFeature: 401>,
|
||||
|
@ -282,7 +282,7 @@ async def test_service_preset_mode_frost_guard_thermostat(
|
||||
assert hass.states.get(climate_entity_livingroom).state == "auto"
|
||||
assert (
|
||||
hass.states.get(climate_entity_livingroom).attributes["preset_mode"]
|
||||
== "Frost Guard"
|
||||
== "frost_guard"
|
||||
)
|
||||
|
||||
# Test service setting the preset mode to "frost guard"
|
||||
@ -779,7 +779,7 @@ async def test_service_preset_mode_already_boost_valves(
|
||||
assert hass.states.get(climate_entity_entrada).state == "auto"
|
||||
assert (
|
||||
hass.states.get(climate_entity_entrada).attributes["preset_mode"]
|
||||
== "Frost Guard"
|
||||
== "frost_guard"
|
||||
)
|
||||
assert hass.states.get(climate_entity_entrada).attributes["temperature"] == 7
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user