Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions homeassistant/components/verisure/alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
CodeFormat,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
Expand Down Expand Up @@ -63,6 +64,11 @@ async def _async_set_arm_state(
self.coordinator.verisure.request, command_data
)
LOGGER.debug("Verisure set arm state %s", state)
if arm_state is None or "data" not in arm_state:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="arm_state_failed",
)
Comment thread
frenck marked this conversation as resolved.
Comment thread
frenck marked this conversation as resolved.
result = None
attempts = 0
while result is None:
Expand Down
5 changes: 5 additions & 0 deletions homeassistant/components/verisure/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
}
}
},
"exceptions": {
"arm_state_failed": {
"message": "Failed to change alarm state. Check your code and try again."
Comment thread
frenck marked this conversation as resolved.
Outdated
}
},
"options": {
"step": {
"init": {
Expand Down