This change fixes a race condition that happens when the device arms the system, but before this happens an update is triggered and brings the system to a wrong state. Furthermore, avoids the AlarmDevice to set "Arm Away" wrong state.
Testing:
From "disarm", trigger the "arm home" state and be sure it doesn't transition back to "disarm", or in a wrong "arm away" state.
Extra Notes (optional):
This change creates a dependency between the AlarmDevice and the arm/disarm caller as it is expected who calls one of these methods, to set the right ending state. While this is not great and would be better to decouple it, it's a good enough solution. At some point, we may want to remove AlarmDevice transforming it in an actual entity.
Checklist
[x] Related issues and proposed changes are filled
[x] Tests are defining the correct and expected behavior
Related Issues
Proposed Changes:
This change fixes a race condition that happens when the device arms the system, but before this happens an update is triggered and brings the system to a wrong state. Furthermore, avoids the
AlarmDevice
to set "Arm Away" wrong state.Testing:
From "disarm", trigger the "arm home" state and be sure it doesn't transition back to "disarm", or in a wrong "arm away" state.
Extra Notes (optional):
This change creates a dependency between the
AlarmDevice
and the arm/disarm caller as it is expected who calls one of these methods, to set the right ending state. While this is not great and would be better to decouple it, it's a good enough solution. At some point, we may want to removeAlarmDevice
transforming it in an actual entity.Checklist