Add support for service callbacks#229
Merged
ikalchev merged 1 commit intoikalchev:devfrom Mar 28, 2020
Merged
Conversation
For some services we want to send all the char value changes at once. This resolves an issue where we send ON and then BRIGHTNESS and the light would go to 100% and then dim to the brightness because each callback would only send one char at a time.
Codecov Report
@@ Coverage Diff @@
## dev #229 +/- ##
==========================================
+ Coverage 62.08% 62.76% +0.67%
==========================================
Files 16 16
Lines 1704 1716 +12
Branches 176 178 +2
==========================================
+ Hits 1058 1077 +19
+ Misses 606 594 -12
- Partials 40 45 +5
|
Contributor
Author
|
@ikalchev Hope you are staying safe. Any chance you could look at this one this weekend? |
This was referenced Mar 22, 2020
Merged
Owner
|
Overall it makes sense. We need to make sure to properly document the fact that you can register callbacks in both the service and the char, which can cause some confusion. |
Contributor
Author
|
Good call. Will send a PR to update the docs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For some services we want to send all the char value
changes at once. This resolves an issue where we send
ON and then BRIGHTNESS and the light would go to 100%
and then dim to the brightness because each callback
would only send one char at a time.
For additional details about why this is needed:
home-assistant/core#32348
home-assistant/core#13695
home-assistant/core#13768
home-assistant/core#32278
The end result is that home assistant can now get sets for a service in one call and do the right thing