Context: This update enhances the AlarmCoordinator by enabling it to handle device disconnections during state polling and updates more gracefully.
Problem Solved: Previously, a device disconnection led to all binary sensors entering an "Unavailable" state, potentially triggering undesired automations, including false alarm activations. To mitigate this, the update allows the AlarmCoordinator to retain the device's last known state instead of defaulting to "Unavailable" during brief disconnections.
Implementation Details:
The AlarmDevice now monitors the connection status through a new device.connected attribute.
This attribute is automatically refreshed once the device reconnects, ensuring the system accurately reflects the current state.
Testing
Approach: To validate the changes, manually disconnect the device and observe the logs for the expected behavior.
Expected Outcome: The binary sensors should maintain their last state instead of showing as "Unavailable".
Extra Notes
Feedback Mechanism: This implementation does not yet offer a direct way to visually confirm the device's connection status outside of log entries. Consequently, implementing issue #139 becomes critical to provide a more intuitive feedback mechanism for users.
Checklist
[x] Related issues and proposed changes are filled
[x] Tests are defining the correct and expected behavior
Related Issues
Proposed Changes
Context: This update enhances the
AlarmCoordinator
by enabling it to handle device disconnections during state polling and updates more gracefully.Problem Solved: Previously, a device disconnection led to all binary sensors entering an "Unavailable" state, potentially triggering undesired automations, including false alarm activations. To mitigate this, the update allows the
AlarmCoordinator
to retain the device's last known state instead of defaulting to "Unavailable" during brief disconnections.Implementation Details:
AlarmDevice
now monitors the connection status through a newdevice.connected
attribute.Testing
Extra Notes
Checklist