Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@puddly
Copy link
Collaborator

@puddly puddly commented Aug 1, 2025

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.

@MattWestb
Copy link
Contributor

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.
You have some sniffs that i have sending you before if you like looking how they is doing but i think in the end the best is looking how end device is doing it in "real" then implementation can being very different.

By the way GREAT WORK DONE !!!

@puddly puddly force-pushed the puddly/active-fast-poll branch from 5dbcc22 to 00a44e4 Compare August 5, 2025 16:42
@codecov
Copy link

codecov bot commented Aug 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.29%. Comparing base (6475f7e) to head (24f4135).
⚠️ Report is 1 commits behind head on dev.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@puddly puddly marked this pull request as ready for review August 5, 2025 16:50
@Copilot Copilot AI review requested due to automatic review settings August 5, 2025 16:50
Copy link

Copilot AI left a 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

@puddly puddly force-pushed the puddly/active-fast-poll branch from 9fe135d to 24f4135 Compare August 5, 2025 17:03
@puddly puddly merged commit c65ae98 into zigpy:dev Aug 5, 2025
22 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants