diff --git a/homeassistant/components/isy994/switch.py b/homeassistant/components/isy994/switch.py index c5fba9cb54b..f6cb68b8a0f 100644 --- a/homeassistant/components/isy994/switch.py +++ b/homeassistant/components/isy994/switch.py @@ -84,12 +84,12 @@ class ISYSwitchEntity(ISYNodeEntity, SwitchEntity): async def async_turn_off(self, **kwargs: Any) -> None: """Send the turn off command to the ISY switch.""" if not await self._node.turn_off(): - HomeAssistantError(f"Unable to turn off switch {self._node.address}") + raise HomeAssistantError(f"Unable to turn off switch {self._node.address}") async def async_turn_on(self, **kwargs: Any) -> None: """Send the turn on command to the ISY switch.""" if not await self._node.turn_on(): - HomeAssistantError(f"Unable to turn on switch {self._node.address}") + raise HomeAssistantError(f"Unable to turn on switch {self._node.address}") @property def icon(self) -> str | None: @@ -110,14 +110,14 @@ class ISYSwitchProgramEntity(ISYProgramEntity, SwitchEntity): async def async_turn_on(self, **kwargs: Any) -> None: """Send the turn on command to the ISY switch program.""" if not await self._actions.run_then(): - HomeAssistantError( + raise HomeAssistantError( f"Unable to run 'then' clause on program switch {self._actions.address}" ) async def async_turn_off(self, **kwargs: Any) -> None: """Send the turn off command to the ISY switch program.""" if not await self._actions.run_else(): - HomeAssistantError( + raise HomeAssistantError( f"Unable to run 'else' clause on program switch {self._actions.address}" ) diff --git a/homeassistant/components/moehlenhoff_alpha2/__init__.py b/homeassistant/components/moehlenhoff_alpha2/__init__.py index 2a254ee0ef4..4992ecf34a7 100644 --- a/homeassistant/components/moehlenhoff_alpha2/__init__.py +++ b/homeassistant/components/moehlenhoff_alpha2/__init__.py @@ -124,7 +124,7 @@ class Alpha2BaseCoordinator(DataUpdateCoordinator[dict[str, dict]]): """Set the mode of the given heat area.""" # HEATAREA_MODE: 0=Auto, 1=Tag, 2=Nacht if heat_area_mode not in (0, 1, 2): - ValueError(f"Invalid heat area mode: {heat_area_mode}") + raise ValueError(f"Invalid heat area mode: {heat_area_mode}") _LOGGER.debug( "Setting mode of heat area %s to %d", heat_area_id,