diff --git a/homeassistant/components/overkiz/executor.py b/homeassistant/components/overkiz/executor.py index 9095ec8d38e..af29dbaf523 100644 --- a/homeassistant/components/overkiz/executor.py +++ b/homeassistant/components/overkiz/executor.py @@ -5,9 +5,12 @@ from typing import Any, cast from urllib.parse import urlparse from pyoverkiz.enums import OverkizCommand, Protocol +from pyoverkiz.exceptions import OverkizException from pyoverkiz.models import Command, Device, StateDefinition from pyoverkiz.types import StateType as OverkizStateType +from homeassistant.exceptions import HomeAssistantError + from .coordinator import OverkizDataUpdateCoordinator # Commands that don't support setting @@ -88,11 +91,15 @@ class OverkizExecutor: ): parameters.append(0) - exec_id = await self.coordinator.client.execute_command( - self.device.device_url, - Command(command_name, parameters), - "Home Assistant", - ) + try: + exec_id = await self.coordinator.client.execute_command( + self.device.device_url, + Command(command_name, parameters), + "Home Assistant", + ) + # Catch Overkiz exceptions to support `continue_on_error` functionality + except OverkizException as exception: + raise HomeAssistantError(exception) from exception # ExecutionRegisteredEvent doesn't contain the device_url, thus we need to register it here self.coordinator.executions[exec_id] = {