Skip to content

Refactor color library to modular structure and update CI for new runtime#2

Merged
blueyetisoftware merged 6 commits intomainfrom
test/busted
Jan 29, 2026
Merged

Refactor color library to modular structure and update CI for new runtime#2
blueyetisoftware merged 6 commits intomainfrom
test/busted

Conversation

@blueyetisoftware
Copy link
Owner

@blueyetisoftware blueyetisoftware commented Jan 29, 2026

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.

@blueyetisoftware blueyetisoftware force-pushed the test/busted branch 3 times, most recently from 4151957 to a03e096 Compare January 29, 2026 05:34
@blueyetisoftware blueyetisoftware changed the title Test/busted Refactor color library to modular structure and update CI for new runtime Jan 29, 2026
@blueyetisoftware blueyetisoftware merged commit 7265575 into main Jan 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant