-
-
Notifications
You must be signed in to change notification settings - Fork 568
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
Cache descriptors on first access #1701
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #1701 +/- ##
==========================================
+ Coverage 81.66% 81.74% +0.08%
==========================================
Files 191 191
Lines 17913 17934 +21
Branches 3843 3845 +2
==========================================
+ Hits 14628 14660 +32
+ Misses 2997 2986 -11
Partials 288 288
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@rytilahti could you review/merge this? |
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.
Looks fairly ready to go to me, please see the comments for some minor issues.
Co-authored-by: Teemu R. <tpr@iki.fi>
@rytilahti the tests are actually succesfull, there is an error uploading the codecov.... |
mocker.patch("miio.Device._sensor_descriptors_from_status", return_value={}) | ||
mocker.patch("miio.Device._setting_descriptors_from_status", return_value={}) | ||
mocker.patch("miio.Device._action_descriptors", return_value={}) | ||
for _i in range(5): |
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.
Just for the future, the proper way to do this is to use plain _
here. No need to fix that now though.
@rytilahti all tests have passed |
The descriptors accessed through
sensors()
,settings()
, andactions()
are now cached on the first use to avoid unnecessary I/O.follow up on PR #1592 which got merge conflicts and is closed.