-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Python] Improve attribute cache code quality (#31074)
* Improve/fix exception handling in attribute update callbacks Commit 79cebcf ("[controller] Fix flake8 warnings (#25311)") changed the exceptions catched from a global catch to a specific catch for chip.exceptions.ChipStackException exceptions. However, in this two cases the error is just converted to a Python enum, there is no case where chip.exceptions.ChipStackException would be raised. Since those callbacks are called from the C++ SDK, to the best of my knowledge, the intention was that exception would not bubble up into SDK code. Handle the Python specific exceptions and make sure they get logged verbosley. * [Python] Simplify UpdateCachedData for better readability Extract cache type implementation in functions. Also make the code a bit more Pythonic. Note: This no longer initializes endpointCache in the Cluster-View. This shouldn't matter in practice as the dictionary wasn't used.
- Loading branch information
Showing
1 changed file
with
30 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters