Refactor color library to modular structure and update CI for new runtime#2
Merged
blueyetisoftware merged 6 commits intomainfrom Jan 29, 2026
Merged
Refactor color library to modular structure and update CI for new runtime#2blueyetisoftware merged 6 commits intomainfrom
blueyetisoftware merged 6 commits intomainfrom
Conversation
4151957 to
a03e096
Compare
a03e096 to
885f96d
Compare
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 PR refactors the color library from a monolithic color.lua file into a modular structure with individual files for each function (e.g., color/cct_to_rgb.lua, color/rgb_to_cct.lua, etc.). This improves code organization, maintainability, and allows for more targeted testing and development.
Key Changes:
Library Refactoring:
Split the single color.lua file into 25+ individual modules in the color/ directory
Created init.lua to export all functions via a unified Color table
Added comprehensive LDoc documentation to each module
Removed the old monolithic color.lua and color.test.lua files
Testing Updates:
Added extensive test suites for all new modules (20+ spec files)
Updated existing tests to match the new modular structure
Fixed luacheck warnings by using _ for unused variables
Adjusted some test tolerances and expected values due to refinements in the underlying color conversion algorithms
CI/CD Updates:
Updated test.yml to use the new SmartThings Edge SDK runtime image (ghcr.io/blueyetisoftware/smartthings-edge-sdk-runtime:16.0.59-51ac4bd)
Simplified the workflow by removing dependency installation steps (busted is now included in the runtime image)
Changed from using the lunarmodules/busted action to running busted spec/ directly
Benefits:
Modularity: Easier to maintain, test, and extend individual color conversion functions
Performance: Faster CI runs with pre-installed dependencies in the runtime image
Reliability: Updated color conversion algorithms provide more accurate results
Documentation: Comprehensive inline documentation for all functions
All tests pass, and the library maintains backward compatibility through the Color table interface.