diff --git a/homeassistant/components/netatmo/climate.py b/homeassistant/components/netatmo/climate.py index c2953b9d49d..752dee5a952 100644 --- a/homeassistant/components/netatmo/climate.py +++ b/homeassistant/components/netatmo/climate.py @@ -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 diff --git a/homeassistant/components/netatmo/icons.json b/homeassistant/components/netatmo/icons.json index 70a51542126..9f712e08f33 100644 --- a/homeassistant/components/netatmo/icons.json +++ b/homeassistant/components/netatmo/icons.json @@ -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" diff --git a/homeassistant/components/netatmo/strings.json b/homeassistant/components/netatmo/strings.json index 3c360634147..6b91aa204b2 100644 --- a/homeassistant/components/netatmo/strings.json +++ b/homeassistant/components/netatmo/strings.json @@ -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" diff --git a/tests/components/netatmo/snapshots/test_climate.ambr b/tests/components/netatmo/snapshots/test_climate.ambr index b9a92882b9e..aeae1fd71c7 100644 --- a/tests/components/netatmo/snapshots/test_climate.ambr +++ b/tests/components/netatmo/snapshots/test_climate.ambr @@ -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': , - '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': , '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': , - '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': , @@ -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': , - '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': , @@ -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': , - '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': , @@ -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': , - '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': , diff --git a/tests/components/netatmo/test_climate.py b/tests/components/netatmo/test_climate.py index 4b908580346..dc0312f7acd 100644 --- a/tests/components/netatmo/test_climate.py +++ b/tests/components/netatmo/test_climate.py @@ -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