diff --git a/homeassistant/components/devolo_home_control/climate.py b/homeassistant/components/devolo_home_control/climate.py index 2f20e82f7fed..90f7003ded0b 100644 --- a/homeassistant/components/devolo_home_control/climate.py +++ b/homeassistant/components/devolo_home_control/climate.py @@ -104,6 +104,5 @@ class DevoloClimateDeviceEntity(DevoloMultiLevelSwitchDeviceEntity, ClimateEntit if not self._multi_level_switch_property.set(kwargs[ATTR_TEMPERATURE]): raise HomeAssistantError( translation_domain=DOMAIN, - translation_key="set", - translation_placeholders={"placeholder": "temperature"}, + translation_key="set_failed", ) diff --git a/homeassistant/components/devolo_home_control/cover.py b/homeassistant/components/devolo_home_control/cover.py index 7f9fc5313c3e..e9d82c3b9609 100644 --- a/homeassistant/components/devolo_home_control/cover.py +++ b/homeassistant/components/devolo_home_control/cover.py @@ -79,6 +79,5 @@ class DevoloCoverDeviceEntity(DevoloMultiLevelSwitchDeviceEntity, CoverEntity): if not self._multi_level_switch_property.set(position): raise HomeAssistantError( translation_domain=DOMAIN, - translation_key="set", - translation_placeholders={"placeholder": "cover position"}, + translation_key="set_failed", ) diff --git a/homeassistant/components/devolo_home_control/light.py b/homeassistant/components/devolo_home_control/light.py index 44c321bd4385..4c627cf01728 100644 --- a/homeassistant/components/devolo_home_control/light.py +++ b/homeassistant/components/devolo_home_control/light.py @@ -88,8 +88,7 @@ class DevoloLightDeviceEntity(DevoloMultiLevelSwitchDeviceEntity, LightEntity): if not self._multi_level_switch_property.set(value): raise HomeAssistantError( translation_domain=DOMAIN, - translation_key="set", - translation_placeholders={"placeholder": "brightness"}, + translation_key="set_failed", ) def _set_switch(self, state: bool) -> None: @@ -102,8 +101,7 @@ class DevoloLightDeviceEntity(DevoloMultiLevelSwitchDeviceEntity, LightEntity): if not self._binary_switch_property.set(state): raise HomeAssistantError( translation_domain=DOMAIN, - translation_key="set", - translation_placeholders={"placeholder": "state"}, + translation_key="set_failed", ) except SwitchingProtected as err: raise ServiceValidationError( diff --git a/homeassistant/components/devolo_home_control/siren.py b/homeassistant/components/devolo_home_control/siren.py index 9235d77f1bbe..ee9f62d53de6 100644 --- a/homeassistant/components/devolo_home_control/siren.py +++ b/homeassistant/components/devolo_home_control/siren.py @@ -83,8 +83,7 @@ class DevoloSirenDeviceEntity(DevoloMultiLevelSwitchDeviceEntity, SirenEntity): if not self._multi_level_switch_property.set(tone): raise HomeAssistantError( translation_domain=DOMAIN, - translation_key="set", - translation_placeholders={"placeholder": "siren's tone"}, + translation_key="set_failed", ) @override diff --git a/homeassistant/components/devolo_home_control/strings.json b/homeassistant/components/devolo_home_control/strings.json index 340d6b8d6e12..c8e4f8bf86e9 100644 --- a/homeassistant/components/devolo_home_control/strings.json +++ b/homeassistant/components/devolo_home_control/strings.json @@ -65,11 +65,11 @@ "maintenance": { "message": "devolo Home Control is currently in maintenance mode." }, - "set": { - "message": "An error occurred while setting the {placeholder}." + "set_failed": { + "message": "The devolo Home Control central unit did not accept the command." }, "switch_protected": { - "message": "Switching is protected by configuration." + "message": "Remote switching is disabled for this device. Please use the physical button." } } } diff --git a/homeassistant/components/devolo_home_control/switch.py b/homeassistant/components/devolo_home_control/switch.py index 14d73f6201cb..bd9a6c37fc13 100644 --- a/homeassistant/components/devolo_home_control/switch.py +++ b/homeassistant/components/devolo_home_control/switch.py @@ -84,8 +84,7 @@ class DevoloSwitch(DevoloDeviceEntity, SwitchEntity): if not self._binary_switch_property.set(state=state): raise HomeAssistantError( translation_domain=DOMAIN, - translation_key="set", - translation_placeholders={"placeholder": "state"}, + translation_key="set_failed", ) except SwitchingProtected as err: raise ServiceValidationError( diff --git a/tests/components/devolo_home_control/test_climate.py b/tests/components/devolo_home_control/test_climate.py index 7cdfa425c193..6922377de8ef 100644 --- a/tests/components/devolo_home_control/test_climate.py +++ b/tests/components/devolo_home_control/test_climate.py @@ -79,9 +79,8 @@ async def test_climate( }, blocking=True, ) - assert error.value.translation_key == "set" + assert error.value.translation_key == "set_failed" assert error.value.translation_domain == DOMAIN - assert error.value.translation_placeholders == {"placeholder": "temperature"} # Emulate websocket message: device went offline test_gateway.devices["Test"].status = 1 diff --git a/tests/components/devolo_home_control/test_cover.py b/tests/components/devolo_home_control/test_cover.py index 841e2cc69354..30e36859a7e2 100644 --- a/tests/components/devolo_home_control/test_cover.py +++ b/tests/components/devolo_home_control/test_cover.py @@ -95,9 +95,8 @@ async def test_cover( {ATTR_ENTITY_ID: f"{COVER_DOMAIN}.test_test", ATTR_POSITION: 50}, blocking=True, ) - assert error.value.translation_key == "set" + assert error.value.translation_key == "set_failed" assert error.value.translation_domain == DOMAIN - assert error.value.translation_placeholders == {"placeholder": "cover position"} # Emulate websocket message: device went offline test_gateway.devices["Test"].status = 1 diff --git a/tests/components/devolo_home_control/test_light.py b/tests/components/devolo_home_control/test_light.py index eab4364d7733..c8ea81c9a2ba 100644 --- a/tests/components/devolo_home_control/test_light.py +++ b/tests/components/devolo_home_control/test_light.py @@ -95,9 +95,8 @@ async def test_light_without_binary_sensor( {ATTR_ENTITY_ID: f"{LIGHT_DOMAIN}.test_test", ATTR_BRIGHTNESS: 50}, blocking=True, ) - assert error.value.translation_key == "set" + assert error.value.translation_key == "set_failed" assert error.value.translation_domain == DOMAIN - assert error.value.translation_placeholders == {"placeholder": "brightness"} # Emulate websocket message: device went offline test_gateway.devices["Test"].status = 1 @@ -171,9 +170,8 @@ async def test_light_with_binary_sensor( {ATTR_ENTITY_ID: f"{LIGHT_DOMAIN}.test_test"}, blocking=True, ) - assert error.value.translation_key == "set" + assert error.value.translation_key == "set_failed" assert error.value.translation_domain == DOMAIN - assert error.value.translation_placeholders == {"placeholder": "state"} with ( patch( diff --git a/tests/components/devolo_home_control/test_siren.py b/tests/components/devolo_home_control/test_siren.py index 4683ebc75b32..82ee8972033d 100644 --- a/tests/components/devolo_home_control/test_siren.py +++ b/tests/components/devolo_home_control/test_siren.py @@ -114,9 +114,8 @@ async def test_siren_switching( {"entity_id": f"{SIREN_DOMAIN}.test_test"}, blocking=True, ) - assert error.value.translation_key == "set" + assert error.value.translation_key == "set_failed" assert error.value.translation_domain == DOMAIN - assert error.value.translation_placeholders == {"placeholder": "siren's tone"} async def test_siren_change_default_tone( diff --git a/tests/components/devolo_home_control/test_switch.py b/tests/components/devolo_home_control/test_switch.py index 557035c07b6f..7af6321b6f76 100644 --- a/tests/components/devolo_home_control/test_switch.py +++ b/tests/components/devolo_home_control/test_switch.py @@ -84,9 +84,8 @@ async def test_switch( {ATTR_ENTITY_ID: f"{SWITCH_DOMAIN}.test_test"}, blocking=True, ) - assert error.value.translation_key == "set" + assert error.value.translation_key == "set_failed" assert error.value.translation_domain == DOMAIN - assert error.value.translation_placeholders == {"placeholder": "state"} with ( patch(