Commit 49ed8a7
committed
Enhance API operation queue with retry logic and device LED control
This update introduces a robust retry mechanism for API operations, allowing failed operations to be retried with exponential backoff. A new `QueuedOperation` class encapsulates operation metadata and retry logic. Additionally, the `ApiOperationQueue` now supports a retry queue for managing failed operations.
Furthermore, the LED toggle functionality has been extended to support various UniFi devices, allowing for LED state management through the queue system. This includes special handling for device LED toggles and updates to the `UnifiLedToggleSwitch` class to inherit resilient patterns from the base switch class.
Key changes:
- Added `QueuedOperation` class for managing queued operations with retries.
- Enhanced `ApiOperationQueue` to include retry logic and queue management.
- Updated LED toggle handling for devices in `switch.py` and `rule.py`.
This improves the integration's reliability and flexibility across a wider range of UniFi hardware.1 parent d4dd109 commit 49ed8a7
3 files changed
Lines changed: 407 additions & 215 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
38 | 49 | | |
39 | 50 | | |
40 | 51 | | |
| |||
63 | 74 | | |
64 | 75 | | |
65 | 76 | | |
| 77 | + | |
66 | 78 | | |
67 | 79 | | |
68 | 80 | | |
| |||
134 | 146 | | |
135 | 147 | | |
136 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
137 | 157 | | |
138 | 158 | | |
139 | 159 | | |
| |||
165 | 185 | | |
166 | 186 | | |
167 | 187 | | |
168 | | - | |
| 188 | + | |
| 189 | + | |
169 | 190 | | |
170 | 191 | | |
171 | 192 | | |
| |||
312 | 333 | | |
313 | 334 | | |
314 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
315 | 346 | | |
316 | 347 | | |
317 | 348 | | |
| |||
341 | 372 | | |
342 | 373 | | |
343 | 374 | | |
| 375 | + | |
| 376 | + | |
344 | 377 | | |
345 | 378 | | |
346 | 379 | | |
| |||
0 commit comments