Closed palazzem closed 4 months ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
custom_components/econnect_metronet/decorators.py | 19 | 40 | 47.5% | ||
<!-- | Total: | 29 | 50 | 58.0% | --> |
Totals | |
---|---|
Change from base Build 9111312503: | -2.1% |
Covered Lines: | 701 |
Relevant Lines: | 769 |
We temporarily accept the code coverage reduction until this code is moved in the underlying econnect-python
library. See https://github.com/palazzem/econnect-python/issues/152.
Related Issues
Proposed Changes:
This change retries all decorated function call or services after obtaining a new refreshed token, if necessary. These decorators have been applied to all calls made by the Alarm Panel and Services.
The set state decorator now handles all exceptions so that, in case of unexpected failure, the previous state is always reverted.
Testing:
Extra Notes (optional):
This change doesn't have unit tests, hence why the code coverage decreased. While this is very sub-optimal for the code quality and reliability, we're working on the underlying implementation refactoring as the retry mechanism must be moved in
econnect-python
. This is necessary otherwise all library users have to implement the refresh token management, increasing heavily the code duplication.As soon as this part is migrated, this code can be removed.
Checklist