diff --git a/homeassistant/components/evohome/button.py b/homeassistant/components/evohome/button.py index ddee41ecd44d..041fdec671b6 100644 --- a/homeassistant/components/evohome/button.py +++ b/homeassistant/components/evohome/button.py @@ -71,6 +71,7 @@ class EvoResetButtonBase(CoordinatorEntity[EvoLocationCoordinator], ButtonEntity class EvoSystemResetButton(EvoResetButtonBase): """Button entity for system reset.""" + _attr_translation_key = "reset_system_mode" _evo_device: evo.ControlSystem @property @@ -83,6 +84,7 @@ class EvoSystemResetButton(EvoResetButtonBase): class EvoDhwResetButton(EvoResetButtonBase): """Button entity for DHW override reset.""" + _attr_translation_key = "clear_dhw_override" _evo_device: evo.HotWater @property @@ -95,6 +97,7 @@ class EvoDhwResetButton(EvoResetButtonBase): class EvoZoneResetButton(EvoResetButtonBase): """Button entity for zone override reset.""" + _attr_translation_key = "clear_zone_override" _evo_device: evo.Zone def __init__( diff --git a/homeassistant/components/evohome/climate.py b/homeassistant/components/evohome/climate.py index f35f3ae9605b..f556f76ecf96 100644 --- a/homeassistant/components/evohome/climate.py +++ b/homeassistant/components/evohome/climate.py @@ -319,7 +319,7 @@ class EvoController(EvoClimateEntity): It is assumed there is only one TCS per location, and they are thus synonymous. """ - _attr_icon = "mdi:thermostat-box" + _attr_translation_key = "controller" _attr_precision = PRECISION_TENTHS _evo_device: evo.ControlSystem diff --git a/homeassistant/components/evohome/icons.json b/homeassistant/components/evohome/icons.json index 87a3d867479a..b08885bcdbe2 100644 --- a/homeassistant/components/evohome/icons.json +++ b/homeassistant/components/evohome/icons.json @@ -10,6 +10,11 @@ "reset_system_mode": { "default": "mdi:thermostat-box-auto" } + }, + "climate": { + "controller": { + "default": "mdi:thermostat-box" + } } }, "services": { diff --git a/tests/components/evohome/snapshots/test_climate.ambr b/tests/components/evohome/snapshots/test_climate.ambr index 3f9733d6c4ca..b3a67bea3bc0 100644 --- a/tests/components/evohome/snapshots/test_climate.ambr +++ b/tests/components/evohome/snapshots/test_climate.ambr @@ -844,7 +844,6 @@ , , ]), - : 'mdi:thermostat-box', : 35, : 7, : 'eco', @@ -883,7 +882,6 @@ , , ]), - : 'mdi:thermostat-box', : 35, : 7, : 'eco', @@ -1330,7 +1328,6 @@ , , ]), - : 'mdi:thermostat-box', : 35, : 7, : 'eco', @@ -1677,7 +1674,6 @@ , , ]), - : 'mdi:thermostat-box', : 35, : 7, : 'eco', @@ -1760,7 +1756,6 @@ , , ]), - : 'mdi:thermostat-box', : 35, : 7, 'status': dict({ @@ -1836,7 +1831,6 @@ , , ]), - : 'mdi:thermostat-box', : 35, : 7, : None, @@ -2053,7 +2047,6 @@ , , ]), - : 'mdi:thermostat-box', : 35, : 7, : None, @@ -2222,7 +2215,6 @@ , , ]), - : 'mdi:thermostat-box', : 35, : 7, : None, @@ -2393,7 +2385,6 @@ , , ]), - : 'mdi:thermostat-box', : 35, : 7, : 'eco', @@ -2432,7 +2423,6 @@ , , ]), - : 'mdi:thermostat-box', : 35, : 7, : 'away', @@ -2570,7 +2560,6 @@ , , ]), - : 'mdi:thermostat-box', : 35, : 7, : 'eco', diff --git a/tests/components/evohome/test_button.py b/tests/components/evohome/test_button.py index 71421fb82f06..bf574b878716 100644 --- a/tests/components/evohome/test_button.py +++ b/tests/components/evohome/test_button.py @@ -153,3 +153,26 @@ async def test_button_press_api_call_failed( ) assert exc_info.value.translation_key == "api_request_failed" + + +@pytest.mark.parametrize("install", ["default"]) +@pytest.mark.parametrize( + ("button_fixture", "translation_key"), + [ + pytest.param("system_button_id", "reset_system_mode", id="system"), + pytest.param("dhw_button_id", "clear_dhw_override", id="dhw"), + pytest.param("zone_button_id", "clear_zone_override", id="zone"), + ], +) +@pytest.mark.usefixtures("evohome") +async def test_reset_button_translation_key( + entity_registry: er.EntityRegistry, + request: pytest.FixtureRequest, + button_fixture: str, + translation_key: str, +) -> None: + """Test each reset button has the translation_key that its icon is keyed by.""" + + entry = entity_registry.async_get(request.getfixturevalue(button_fixture)) + assert entry is not None + assert entry.translation_key == translation_key diff --git a/tests/components/evohome/test_climate.py b/tests/components/evohome/test_climate.py index 3f9402fdc1e8..09ff929cb1a8 100644 --- a/tests/components/evohome/test_climate.py +++ b/tests/components/evohome/test_climate.py @@ -21,6 +21,7 @@ from homeassistant.components.climate import ( from homeassistant.const import TargetKey from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError, ServiceValidationError +from homeassistant.helpers import entity_registry as er from .conftest import setup_evohome from .const import TEST_INSTALLS @@ -491,3 +492,16 @@ async def test_zone_turn_on( ) mock_fcn.assert_awaited_once_with() + + +@pytest.mark.parametrize("install", ["default"]) +@pytest.mark.usefixtures("evohome") +async def test_ctl_translation_key( + entity_registry: er.EntityRegistry, + ctl_id: str, +) -> None: + """Test the controller has the translation_key that its icon is keyed by.""" + + entry = entity_registry.async_get(ctl_id) + assert entry is not None + assert entry.translation_key == "controller"