Make util.color._match_max_scale public#59207
Merged
balloob merged 2 commits intohome-assistant:devfrom Nov 11, 2021
Merged
Conversation
marvin-w
approved these changes
Nov 5, 2021
Contributor
marvin-w
left a comment
There was a problem hiding this comment.
Looks good to me, let's see what the others say.
Member
|
I think its fine to make it public, but we should also test it directly in that case in |
farmio
commented
Nov 6, 2021
| # Match the output maximum value to the input. This ensures the full | ||
| # channel range is used. | ||
| return _match_max_scale((r, g, b), rgbw) # type: ignore | ||
| return match_max_scale((r, g, b), rgbw) # type: ignore[return-value] |
Member
Author
There was a problem hiding this comment.
Shall we add @overloads for the used tuple length variations (3, 4 and 5 x int)? or better keep the ignores?
This would add ~20 lines to the code just for type variations 😬
balloob
approved these changes
Nov 11, 2021
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Proposed change
Make util.color._match_max_scale public.
I'd like to use it in an integration for converting RGB values with normalized brightness to the HA used model of independent brightness and RGB levels.
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: