-
Notifications
You must be signed in to change notification settings - Fork 127
Allow kwargs to throttled functions, await sleep in throttle #823
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
Allow kwargs to throttled functions, await sleep in throttle #823
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #823 +/- ##
==========================================
- Coverage 99.86% 99.86% -0.01%
==========================================
Files 8 8
Lines 1454 1453 -1
==========================================
- Hits 1452 1451 -1
Misses 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Unfortunately, just adding kwargs and moving to .get() does not address the update issue due to the lower level API calls also being wrapped with |
update tests
Increase timeout
OK - this appears to do the trick - The throttle waits the prescribed time then returns the function rather than None. |
Thoughts on this way to address the issue? |
@mkmer yeah I like this approach. I'm ready to merge unless you can think of a way to test the throttling- right now I think we could remove decorators and the test would still pass (but maybe I'm wrong- my mental model of all this is a bit hazy) |
Could we do a release for this pr soon? It addresses slow responses to motion arm/disarm switch I recently added to HA. We missed 2023.12 but maybe I can get it in 2023.12.1. |
Please? Maybe 2024.1 |
Yeah sorry, meant to get around to it last week but held off because I needed to test another PR before merging (and wanted to get that into a release as well) but, as usual, life laughed at me and kicked me in the 'nads |
Description:
Move back to .get() for throttle kwargs
Add time delay to actually "throttle" the call rather than "ignore" the call.
Related issue (if applicable): fixes #
Checklist:
tox
run successfully PR cannot be meged unless tests pass