Skip to content

Commit

Permalink
fix: support keypad off mode for alarm panel
Browse files Browse the repository at this point in the history
  • Loading branch information
fuatakgun committed Jan 4, 2023
1 parent 1985b27 commit 0ce1349
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/eufy_security/alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

_LOGGER: logging.Logger = logging.getLogger(__package__)

KEYPAD_OFF_CODE = 6


class CurrentModeToState(Enum):
"""Alarm Entity Mode to State"""
Expand Down Expand Up @@ -155,6 +157,8 @@ def state(self):
if triggered is True:
return CurrentModeToStateValue.TRIGGERED.value
current_mode = get_child_value(self.product.properties, self.metadata.name, -1)
if current_mode == KEYPAD_OFF_CODE:
return CurrentModeToStateValue[CurrentModeToState.DISARMED].value
if current_mode in CUSTOM_CODES:
position = CUSTOM_CODES.index(current_mode)
if position == 0:
Expand Down

0 comments on commit 0ce1349

Please sign in to comment.