Skip to content

Commit

Permalink
Fix index out of range when no stay profile for partition configured.
Browse files Browse the repository at this point in the history
  • Loading branch information
RenierM26 committed Aug 11, 2022
1 parent f8ce29f commit 7940f46
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions custom_components/ids_hyyp/alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ def __init__(
self._arm_code = arm_code
self._attr_unique_id = f"{self._site_id}_{partition_id}"
self._attr_code_arm_required = bool(arm_code)
self._arm_home_profile_id = list(self.partition_data["stayProfiles"])[
0
] # Supports multiple stay profiles. Assume first is arm home.
self._arm_home_profile_id = (
(list(self.partition_data["stayProfiles"])[0])
if self.partition_data["stayProfiles"]
else 0
) # Supports multiple stay profiles. Assume first is arm home.

@property
def available(self) -> bool:
Expand Down

0 comments on commit 7940f46

Please sign in to comment.