Skip to content

Commit

Permalink
fix: map keypad alarm off to disarmed
Browse files Browse the repository at this point in the history
  • Loading branch information
fuatakgun committed Jan 5, 2023
1 parent 64b0a28 commit 6a21ce7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Welcome to Alpha release of Eufy Security Integration for Home Assistant. Congra
- Country code is very crucial to connect to correct regional servers. If your main account has setup in US and if you are trying to login into your secondary account in DE country, your device data would not be found in EU servers. So please pay attention to put correct country code. (Source: Alpha 2 country code https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements)
- Event duration in seconds correspond to how long (in seconds) entities in home assistant would stay in active. As an example, when camera notices a person, add-on would receive a push notification from eufy and home assistant integration will active person detected sensor and person detected sensor will stay on state for `event duration in seconds` long.
- Trusted device name is a required identifier for eufy systems to record this add-on as mobile client, so you can differentiate the connection from this add-on in multi factor authentication (two factor authentication) page.
- **As we already called out earlier, add-on heavily relies on push notifications, so you must enable all kind of push notifications (motion detected, person detected, lock events, alarm events etc) in your mobile app. These notifications are not user based but device based so after enabling all these notifications, your main account will probably bloated with many push notifications. In android, there is a setting to disable specific notifications, please use it. **
- As we already called out earlier, add-on heavily relies on push notifications, so you must enable all kind of push notifications (motion detected, person detected, lock events, alarm events etc) in your mobile app. These notifications are not user based but device based so after enabling all these notifications, your main account will probably bloated with many push notifications. In android, there is a setting to disable specific notifications, please use it.

# Supported or Known Working devices

Expand Down
3 changes: 2 additions & 1 deletion custom_components/eufy_security/alarm_control_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ def state(self):
if triggered is True:
return CurrentModeToStateValue.TRIGGERED.value
current_mode = get_child_value(self.product.properties, self.metadata.name, -1)
current_mode = KEYPAD_OFF_CODE
if current_mode == KEYPAD_OFF_CODE:
return CurrentModeToStateValue[CurrentModeToState.DISARMED].value
return CurrentModeToStateValue[CurrentModeToState.DISARMED.name].value
if current_mode in CUSTOM_CODES:
position = CUSTOM_CODES.index(current_mode)
if position == 0:
Expand Down

2 comments on commit 6a21ce7

@cdnninja
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was browsing and ran into this. Wouldn't the if statement always be true since right prior to it the value is set to the same item and the prior value is removed.

@fuatakgun
Copy link
Owner Author

@fuatakgun fuatakgun commented on 6a21ce7 Jan 6, 2023 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.