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
[x] Related issues and proposed changes are filled
[x] Tests are defining the correct and expected behavior
Related Issues
Proposed Changes:
This change introduces
AlarmDevice.get_state()
that maps activated sectors with HA compatible states. If users configure the integration to setALARM_HOME = [3, 4]
, the state is set toHOME
if sectors 3 and 4 are armed.The transition happens immediately after the command is triggered, and when the
AlarmDevice
updates its state through theupdate()
call.Testing:
AlarmDevice
states mapping are testedTo 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