Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(entity): state transitions support users configurations #32

Merged
merged 7 commits into from
Sep 8, 2023

Conversation

palazzem
Copy link
Owner

@palazzem palazzem commented Sep 8, 2023

Related Issues

Proposed Changes:

This change introduces AlarmDevice.get_state() that maps activated sectors with HA compatible states. If users configure the integration to set ALARM_HOME = [3, 4], the state is set to HOME if sectors 3 and 4 are armed.

The transition happens immediately after the command is triggered, and when the AlarmDevice updates its state through the update() call.

Testing:

  • Instant transitions through entity decorator are tested
  • AlarmDevice states mapping are tested

To test this PR, configure a alarm home and night options, then enable alarm home and then switch to night.

Extra Notes (optional):

Some refactoring has been done to organize better the changes.

Checklist

  • Related issues and proposed changes are filled
  • Tests are defining the correct and expected behavior
  • Code is well-documented via docstrings

@palazzem palazzem added this to the 0.3.0 milestone Sep 8, 2023
@palazzem palazzem self-assigned this Sep 8, 2023
@palazzem palazzem merged commit ace5d93 into main Sep 8, 2023
3 checks passed
@palazzem palazzem deleted the palazzem/issue-24 branch September 8, 2023 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

UI bug when arming night sector after arming home away
1 participant