Skip to content
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

Reduce the number of polling tasks #21

Merged
merged 3 commits into from
Mar 31, 2024
Merged

Reduce the number of polling tasks #21

merged 3 commits into from
Mar 31, 2024

Conversation

dmulcahey
Copy link
Contributor

@dmulcahey dmulcahey commented Mar 31, 2024

This PR creates 2 helpers that are used to reduce the overhead needed to refresh polling things.

GlobalUpdater is added to refresh things that need to update from local state (non async). DeviceCounterSensor, RSSISensor and LQISensor are currently using this. These should be updated to leverage events or callbacks once zigpy provides the appropriate feedback mechanism.

DeviceAvailabilityChecker is added to periodically check the available state of a device

a new flag was also added to Device that tracks whether or not a device is on the network

fixes #9
fixes #10

Copy link

codecov bot commented Mar 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.55%. Comparing base (db12f68) to head (89fd3cd).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #21      +/-   ##
==========================================
+ Coverage   93.50%   93.55%   +0.05%     
==========================================
  Files          61       61              
  Lines        9330     9409      +79     
==========================================
+ Hits         8724     8803      +79     
  Misses        606      606              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dmulcahey dmulcahey merged commit 6f0d07f into dev Mar 31, 2024
6 checks passed
@dmulcahey dmulcahey deleted the dm/reduce-tasks branch March 31, 2024 01:19
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.

Reduce device availability overhead Reduce counter sensor overhead
1 participant