Merged
Conversation
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.
This pull request introduces several improvements and refactors to the animated scenes custom component for Home Assistant, focusing on enhanced color handling and documentation. The most significant updates are the expanded support for "nearby color" perturbations and improved RGB conversion logic for various color types. These changes make the component more robust and user-friendly, especially when working with different light color modes.
Color handling enhancements
_convert_to_rgband_convert_back_to_original_color_typemethods to reliably translate between color representations.find_nearby_colormethod to use HLS space perturbation for all supported color types, improving color variation and accuracy. Added clamping and cyclic handling for HLS values, and ensured output matches the original color type._rgb_to_kelvinto approximate the kelvin value from an RGB triple, enabling round-trip conversion for color temperature types.Configuration and logging
nearby_colorsto the range 0–10, reflecting the new documented behavior.Documentation improvements
README.MDfor downloads, releases, license, activity, and HACS support, and defined badge links at the end of the file for easier maintenance. [1] [2]nearby_colorsconfiguration option, specifying that the valid range is now 1–10 (instead of 1–100) and removing the RGB-specific caveat.Constants and limits
MIN_KELVINandMAX_KELVINconstants inconst.pyand used them throughout the codebase for color temperature bounds, replacing hardcoded values. [1] [2] [3]These changes collectively improve the flexibility, reliability, and maintainability of the animated scenes integration, especially when dealing with a variety of light color modes and user configurations.