This change forces a full update when UpdateFailed exception is detected. If that happens, very likely there is a connectivity error and there is a chance the backend considers the connection with the central unit gone. In that case, it resets last known IDs, causing the integration to not detect any new change as described in #51.
Instead of adding the fix, this PR also refactors entirely how the DataUpdateCoordinator is exposed to the integration, so that now it's a self contained coordinator called AlarmCoordinator. The coordinator is fully tested and a regression test is added to the test suite.
Testing:
Install the latest version that includes this change
Produce updates for 1-2 minutes (e.g. trigger some inputs)
Test 1: disconnect the central unit and reconnect immediately
The integration must be stuck, it should recover within 5 minutes
Produce updates for 1-2 minutes (e.g. trigger some inputs)
Test 2: disconnect the central unit and reconnect after 5-10 minutes
The integration must be stuck, it should recover within 5 minutes
Extra Notes (optional):
n/a
Checklist
[x] Related issues and proposed changes are filled
[x] Tests are defining the correct and expected behavior
Related Issues
Proposed Changes:
This change forces a full update when
UpdateFailed
exception is detected. If that happens, very likely there is a connectivity error and there is a chance the backend considers the connection with the central unit gone. In that case, it resets last known IDs, causing the integration to not detect any new change as described in #51.This fix is available in this commit: https://github.com/palazzem/ha-econnect-alarm/pull/68/commits/588082b455c8e005c290dce3b6c66eaf649e70b3
Instead of adding the fix, this PR also refactors entirely how the
DataUpdateCoordinator
is exposed to the integration, so that now it's a self contained coordinator calledAlarmCoordinator
. The coordinator is fully tested and a regression test is added to the test suite.Testing:
Extra Notes (optional):
n/a
Checklist