-
Notifications
You must be signed in to change notification settings - Fork 193
Active fast poll context manager #1634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
What i have seen is IKEA Dirigera sending fast pull then end devices have joining the network and getting the updated link key = the device is still in "init mode" so its not normal run mode. By the way GREAT WORK DONE !!! |
5dbcc22 to
00a44e4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1634 +/- ##
=======================================
Coverage 99.29% 99.29%
=======================================
Files 57 57
Lines 11608 11636 +28
=======================================
+ Hits 11526 11554 +28
Misses 82 82 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements an active fast poll context manager to improve OTA update performance by maintaining devices in fast poll mode during the transfer process. The implementation replaces time-based fast polling with a state-based approach that responds to all check-in requests during the context manager's lifetime.
Key changes:
- Added a
fast_poll_mode()context manager to automatically manage device fast polling state - Replaced datetime-based fast polling tracking with a boolean flag system
- Integrated the fast poll context manager into the OTA transfer process
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| zigpy/ota/manager.py | Wraps OTA transfer with fast poll context manager |
| zigpy/device.py | Implements fast poll context manager and refactors polling logic from time-based to state-based |
| zigpy/application.py | Removes call to deprecated reset_timers() method |
| tests/test_device.py | Updates tests to use new fast polling API and removes obsolete timer-based tests |
9fe135d to
24f4135
Compare
For use with OTA, I've created an active fast poll context manager. This responds to all check-in requests for the duration of the context manager lifetime to maintain the device in fast poll mode. This theoretically will speed up OTA for some slow devices, eventually.
I'm not seeing a consistent way to enter fast poll mode for devices, however: on some, writing to the fast poll timeout attribute works. On others, it does not. Others do not respond to an unsolicited checkin response.